summaryrefslogtreecommitdiffstats
path: root/doc/CMakeLists.txt
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2020-05-31 20:18:46 +0200
committerSlávek Banko <[email protected]>2020-06-07 14:44:55 +0200
commitfc6faad222c61a586710387ebe673c49feb7b39c (patch)
treefba3a7a21875866dec4ad39eb7d40fd6856f4705 /doc/CMakeLists.txt
parentd428cb79108e112a915c594263523e2c708e4a5d (diff)
downloadabakus-fc6faad222c61a586710387ebe673c49feb7b39c.tar.gz
abakus-fc6faad222c61a586710387ebe673c49feb7b39c.zip
Use common cmake rules for documentation.
Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit 4057927e594b2a6d2e851d9a3f2cae2ef04a6a73)
Diffstat (limited to 'doc/CMakeLists.txt')
-rw-r--r--doc/CMakeLists.txt33
1 files changed, 25 insertions, 8 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index cd4611d..2fbde7f 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,13 +1,30 @@
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
- "${_linguas}" MATCHES "^;*$" OR
- ";${_linguas};" MATCHES ";${_dir};" )
- add_subdirectory( ${_dir} )
- endif( )
+foreach( _dir IN LISTS _dirs )
+ if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}
+ AND NOT "${_dir}" STREQUAL "man"
+ 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}/man/CMakeLists.txt )
+ add_subdirectory( man )
+endif()