summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-05-03 15:01:56 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-05-03 15:02:37 +0200
commit1347d3cadf136ebe4287afd94a1853f95fda8e59 (patch)
tree40697291210ca223fae7526712fa964097106d5e /doc
parent115550a1e895d03f2a279b66dcfd5d04b6a6645b (diff)
downloadkvpnc-1347d3cadf136ebe4287afd94a1853f95fda8e59.tar.gz
kvpnc-1347d3cadf136ebe4287afd94a1853f95fda8e59.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 6f3d0003b34c0e9458423500d5ca7ebd0e33a23d)
Diffstat (limited to 'doc')
-rw-r--r--doc/CMakeLists.txt22
-rw-r--r--doc/tdeioslave/CMakeLists.txt15
2 files changed, 31 insertions, 6 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 463cb40..19e0c1e 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,6 +1,18 @@
-add_subdirectory( de )
-add_subdirectory( en )
-add_subdirectory( fr )
-add_subdirectory( sv )
-add_subdirectory( man )
+file( GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * )
+string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" )
+
+list( REMOVE_ITEM _dirs "tdeioslave" )
+
+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()
+
add_subdirectory( tdeioslave )
diff --git a/doc/tdeioslave/CMakeLists.txt b/doc/tdeioslave/CMakeLists.txt
index c938175..70d6348 100644
--- a/doc/tdeioslave/CMakeLists.txt
+++ b/doc/tdeioslave/CMakeLists.txt
@@ -1 +1,14 @@
-add_subdirectory( en )
+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()