summaryrefslogtreecommitdiffstats
path: root/doc/CMakeLists.txt
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2020-05-02 16:34:48 +0200
committerSlávek Banko <[email protected]>2020-05-02 16:35:30 +0200
commitce354b90f1641d4069df28928c759185afd08c86 (patch)
tree26044d5c1ab25df1eed8d91145ddcc8f687e8cb5 /doc/CMakeLists.txt
parent4b1f8ee56e9222272f06a0e058d363e8209a7048 (diff)
downloadkshutdown-ce354b90f1641d4069df28928c759185afd08c86.tar.gz
kshutdown-ce354b90f1641d4069df28928c759185afd08c86.zip
Move translations to a new directory layout.
Add support for LINGUAS for listing translations to install. Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit 6e896b3d1abed2b310c43fbba0c0798ac4f9ade2)
Diffstat (limited to 'doc/CMakeLists.txt')
-rw-r--r--doc/CMakeLists.txt15
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 6d0aa9f..70d6348 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1 +1,14 @@
-tde_auto_add_subdirectories( )
+file( GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * )
+string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" )
+
+foreach( _dir ${_dirs} )
+ if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_dir} AND
+ EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/CMakeLists.txt )
+ if( "${_dir}" STREQUAL "en" OR
+ "${_dir}" STREQUAL "man" OR
+ "${_linguas}" MATCHES "^;*$" OR
+ ";${_linguas};" MATCHES ";${_dir};" )
+ add_subdirectory( ${_dir} )
+ endif( )
+ endif()
+endforeach()