diff options
author | Slávek Banko <[email protected]> | 2020-06-17 17:39:05 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2020-06-17 18:00:29 +0200 |
commit | 2b1e96facec89dca959a32a4b27c48703abee8ea (patch) | |
tree | de394b8a135d95f167a62f927034b1c89b8d5a68 /doc | |
parent | 6ac3293a616ea771885496c84cce788959ad1d89 (diff) | |
download | kchmviewer-2b1e96facec89dca959a32a4b27c48703abee8ea.tar.gz kchmviewer-2b1e96facec89dca959a32a4b27c48703abee8ea.zip |
Move translations to a new directory layout.
Add support for LINGUAS for listing translations to install.
Use common cmake rules for documentation.
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit bbee8816a455ab39501f68969b07bc191de3aaca)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/CMakeLists.txt | 74 | ||||
-rw-r--r-- | doc/en/CMakeLists.txt | 1 | ||||
-rw-r--r-- | doc/tdeioslave/CMakeLists.txt | 1 | ||||
-rw-r--r-- | doc/tdeioslave/en/CMakeLists.txt | 1 | ||||
-rw-r--r-- | doc/tdeioslave/en/msits/CMakeLists.txt | 1 |
5 files changed, 71 insertions, 7 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 185eab9..16eea36 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,3 +1,71 @@ -add_subdirectory( man ) -tde_conditional_add_subdirectory( WITH_TDE en ) -tde_conditional_add_subdirectory( WITH_TDE tdeioslave ) + +if( WITH_TDE ) + +string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" ) + +# base documentation +file( GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * ) +list( REMOVE_ITEM _dirs "tdeioslave" ) + +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() + + +# tdeioslave documentation +file( GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/tdeioslave tdeioslave/*/* ) + +foreach( _dir IN LISTS _dirs ) + get_filename_component( _lang ${_dir} DIRECTORY ) + get_filename_component( _protocol ${_dir} NAME ) + if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tdeioslave/${_dir} + AND NOT "${_lang}" STREQUAL "man" + AND ( "${_lang}" STREQUAL "en" OR + "${_linguas}" MATCHES "^;*$" OR + ";${_linguas};" MATCHES ";${_lang};" )) + file( GLOB _doc_files + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/tdeioslave/${_dir} + tdeioslave/${_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 tdeioslave/${_dir} + ${_noindex} + LANG ${_lang} + DESTINATION tdeioslave/${_protocol} + ) + endif() + endif() +endforeach() + +endif( WITH_TDE ) + + +if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/man/CMakeLists.txt ) + add_subdirectory( man ) +endif() diff --git a/doc/en/CMakeLists.txt b/doc/en/CMakeLists.txt deleted file mode 100644 index ba3ef3e..0000000 --- a/doc/en/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -tde_create_handbook( DESTINATION ${PROJECT_NAME} ) diff --git a/doc/tdeioslave/CMakeLists.txt b/doc/tdeioslave/CMakeLists.txt deleted file mode 100644 index c938175..0000000 --- a/doc/tdeioslave/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory( en ) diff --git a/doc/tdeioslave/en/CMakeLists.txt b/doc/tdeioslave/en/CMakeLists.txt deleted file mode 100644 index a91f2c1..0000000 --- a/doc/tdeioslave/en/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory( msits ) diff --git a/doc/tdeioslave/en/msits/CMakeLists.txt b/doc/tdeioslave/en/msits/CMakeLists.txt deleted file mode 100644 index fcbaa9b..0000000 --- a/doc/tdeioslave/en/msits/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -tde_create_handbook( DESTINATION tdeioslave/msits ) |