diff options
author | gregory guy <gregory-tde@laposte.net> | 2020-09-30 16:23:35 +0200 |
---|---|---|
committer | gregory guy <gregory-tde@laposte.net> | 2020-10-11 13:12:40 +0200 |
commit | cf1333ecb3899315c395f307ac66c6f12ce82de6 (patch) | |
tree | 28384441987808c8b2c5e9e3bd938775543a9571 /po/CMakeLists.txt | |
parent | 774fc9c3fab286c8040bdd37f088f628769c2694 (diff) | |
download | klcddimmer-cf1333ecb3899315c395f307ac66c6f12ce82de6.tar.gz klcddimmer-cf1333ecb3899315c395f307ac66c6f12ce82de6.zip |
Drop automake build support.
Add basic cmake build instructions.
Deleted empty files ChangeLog and TODO.
Rework of the README and NEWS files.
Some cosmetics.
Signed-off-by: gregory guy <gregory-tde@laposte.net>
Diffstat (limited to 'po/CMakeLists.txt')
-rw-r--r-- | po/CMakeLists.txt | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 46fba83..75c89f8 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -1,6 +1,14 @@ -# build translations if some are already available +file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po ) +string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" ) -file( GLOB _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po ) -if( _srcs ) - tde_create_translation( LANG auto OUTPUT_NAME ${PROJECT_NAME} ) -endif( ) +foreach( _po ${po_files} ) + get_filename_component( _lang ${_po} NAME_WE ) + if( "${_linguas}" MATCHES "^;*$" OR ";${_linguas};" MATCHES ";${_lang};" ) + if( "${_po}" MATCHES "^([^/]*)/.*" ) + string( REGEX REPLACE "^([^/]*)/.*" "\\1" _component "${_po}" ) + else( ) + set( _component "${PROJECT_NAME}" ) + endif( ) + tde_create_translation( FILES ${_po} LANG ${_lang} OUTPUT_NAME ${_component} ) + endif( ) +endforeach( ) |