From fc6faad222c61a586710387ebe673c49feb7b39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 31 May 2020 20:18:46 +0200 Subject: [PATCH] Use common cmake rules for documentation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 4057927e594b2a6d2e851d9a3f2cae2ef04a6a73) --- doc/CMakeLists.txt | 33 +++++++++++++++++++++++++-------- doc/en/CMakeLists.txt | 12 ------------ doc/en/SConscript | 12 ------------ 3 files changed, 25 insertions(+), 32 deletions(-) delete mode 100644 doc/en/CMakeLists.txt delete mode 100644 doc/en/SConscript 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() diff --git a/doc/en/CMakeLists.txt b/doc/en/CMakeLists.txt deleted file mode 100644 index 68a3d33..0000000 --- a/doc/en/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -################################################# -# -# (C) 2011 Timothy Pearson -# kb9vqf (AT) pearsoncomputing.net -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -tde_create_handbook( LANG en DESTINATION abakus ) diff --git a/doc/en/SConscript b/doc/en/SConscript deleted file mode 100644 index ef81fcd..0000000 --- a/doc/en/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/python - -Import('env') - -import glob - -sources = glob.glob("*.png") - -destination = 'abakus' -for lang in ['en']: - for pic in sources: - env.KDEinstall('KDEDOC', "%s/%s" % (lang, destination), pic)