summaryrefslogtreecommitdiffstats
path: root/doc/CMakeLists.txt
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-01-15 13:12:21 +0100
committerSlávek Banko <slavek.banko@axis.cz>2021-01-15 13:13:17 +0100
commitfd24c73cb34da8db534aec43b859999dea6a47d0 (patch)
treebccc5d1b4216a1f3bcaa3fbc1e4e901830131725 /doc/CMakeLists.txt
parent1e3a83b5cfae052d95badae698d09bb7c727af4a (diff)
downloadtdenetworkmanager-fd24c73c.tar.gz
tdenetworkmanager-fd24c73c.zip
Use common cmake rules for documentation.
Move the documentation to the usual layout. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 8c180d8033d4bbb04f11123703f18ca1aabe0647)
Diffstat (limited to 'doc/CMakeLists.txt')
-rw-r--r--doc/CMakeLists.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..f6eec15
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,34 @@
+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()