diff options
author | Slávek Banko <[email protected]> | 2020-04-06 16:50:23 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2020-04-06 16:50:41 +0200 |
commit | 17f4b39bff15baa51a58ac8190277669d41f445f (patch) | |
tree | 75e65d0d0146a89c8567784bcb7aa728f17e445f /doc | |
parent | 9e2a93cd6cf264e9e91d84766c4929cdf5848cc2 (diff) | |
download | kkbswitch-17f4b39bff15baa51a58ac8190277669d41f445f.tar.gz kkbswitch-17f4b39bff15baa51a58ac8190277669d41f445f.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 f95858cd2e274efdaf99ccdc9b3bf62bb6914adb)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/CMakeLists.txt | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index f9197e5..70d6348 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,2 +1,14 @@ -add_subdirectory( en ) -add_subdirectory( man ) +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() |