summaryrefslogtreecommitdiffstats
path: root/doc/CMakeLists.txt
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-05-05 01:21:16 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-05-05 01:22:03 +0200
commit0c1e1c9a6a60c106c3acd24139f014779c6a31ca (patch)
treeb8262f23ac30bfa16035401df406be76c5e5bff4 /doc/CMakeLists.txt
parentfce76be97164bd8d6be3645ed7b979e768f24981 (diff)
downloadtdeio-sword-0c1e1c9a6a60c106c3acd24139f014779c6a31ca.tar.gz
tdeio-sword-0c1e1c9a6a60c106c3acd24139f014779c6a31ca.zip
Move translations to a new directory layout.
Add support for LINGUAS for listing translations to install. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit e134118659802bf6916cc7b7b4665173ee7c467c)
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()