summaryrefslogtreecommitdiffstats
path: root/doc/CMakeLists.txt
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2020-10-02 16:02:41 +0200
committerSlávek Banko <[email protected]>2020-10-02 16:03:32 +0200
commit1b1abc1391aab40899280c1d8a09158a018a163a (patch)
treea03c3f22183537c259fdbaba93c62114762bee42 /doc/CMakeLists.txt
parentfeaba7791cc42d169f48b06e7280acd942db8e10 (diff)
downloadkshowmail-1b1abc1391aab40899280c1d8a09158a018a163a.tar.gz
kshowmail-1b1abc1391aab40899280c1d8a09158a018a163a.zip
Use common cmake rules for documentation.
Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit 259a640088089028370d4914c923d29010ea87ea)
Diffstat (limited to 'doc/CMakeLists.txt')
-rw-r--r--doc/CMakeLists.txt43
1 files changed, 34 insertions, 9 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index ca7faeb..f6eec15 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,9 +1,34 @@
-add_subdirectory( en )
-add_subdirectory( de )
-add_subdirectory( es )
-add_subdirectory( sv )
-add_subdirectory( fr )
-add_subdirectory( hu )
-add_subdirectory( it )
-add_subdirectory( ru )
-add_subdirectory( man )
+file( GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * )
+list( REMOVE_ITEM _dirs html man )
+
+string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" )
+
+foreach( _dir IN LISTS _dirs )
+ if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}
+ AND ( "${_dir}" STREQUAL "en" OR
+ "${_linguas}" MATCHES "^;*$" OR
+ ";${_linguas};" MATCHES ";${_dir};" ))
+ file( GLOB _doc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${_dir} ${_dir}/*.docbook )
+ if( _doc_files )
+ list( FIND _doc_files "index.docbook" _find_index )
+ if( -1 EQUAL _find_index )
+ set( _noindex "NOINDEX" )
+ else()
+ unset( _noindex )
+ endif()
+ tde_create_handbook(
+ SOURCE_BASEDIR ${_dir}
+ ${_noindex}
+ LANG ${_dir}
+ DESTINATION ${PROJECT_NAME}
+ )
+ endif()
+ endif()
+endforeach()
+
+if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html/CMakeLists.txt )
+ add_subdirectory( html )
+endif()
+if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/man/CMakeLists.txt )
+ add_subdirectory( man )
+endif()