summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-05-23 17:06:32 +0200
committerSlávek Banko <slavek.banko@axis.cz>2021-05-24 11:55:32 +0200
commit1a9c8e96fb690f05b9a360727628f682faeadeb1 (patch)
treea864c56566054c9fc577c1f93219aae1e4a6ac63 /CMakeLists.txt
parentd85e0d90d080edf4572def182d216df987f2cf0a (diff)
downloadtdeutils-1a9c8e96fb690f05b9a360727628f682faeadeb1.tar.gz
tdeutils-1a9c8e96fb690f05b9a360727628f682faeadeb1.zip
Use CMake rules instead of calling external shell scripts
generate_apidox and install_apidox from the cmake submodule folder. After generating apidox, links pointing to build directory are fixed. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit dbce3eb86765ab1f33afa5f282b2a0f63b4384e8) Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt42
1 files changed, 36 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07e4e78..d42fd8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -130,13 +130,43 @@ option( BUILD_SUPERKARAMBA "Build superkaramba" ${BUILD_ALL} )
##### add apidox targets ############
-add_custom_target(apidox
- COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/qt3/doc/html"
- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
+if( "${CMAKE_VERSION}" VERSION_LESS "3.1" )
+ set( CMAKE_ENV "env" )
+else()
+ set( CMAKE_ENV "${CMAKE_COMMAND};-E;env" )
+endif()
+
+add_custom_target( apidox
+ COMMAND ${CMAKE_ENV}
+ "QTDOCDIR=/usr/share/tqt3/doc/html"
+ "DOXDATA=${HTML_INSTALL_DIR}/en/common"
+ ${CMAKE_SOURCE_DIR}/admin/doxygen.sh
+ --no-modulename
+ ${CMAKE_SOURCE_DIR}
+ COMMAND
+ find ${CMAKE_BINARY_DIR}/apidocs -name '*.html' |
+ xargs -r sed -i 's|${CMAKE_BINARY_DIR}/apidocs|${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs|g'
+ COMMAND
+ find ${CMAKE_BINARY_DIR}/apidocs -name '*.tag' |
+ xargs -r sed -i 's|${CMAKE_SOURCE_DIR}/|${PROJECT_NAME}/|g'
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+)
+
+add_custom_target( install-apidox
+ COMMAND ${CMAKE_COMMAND} -E echo Apidox installed in ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs
+)
+
+install( CODE "
+ if( EXISTS ${CMAKE_BINARY_DIR}/apidocs )
+ file(
+ INSTALL ${CMAKE_BINARY_DIR}/apidocs/
+ DESTINATION ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs
+ PATTERN doxygen_sqlite3.db EXCLUDE
+ PATTERN installdox-slow EXCLUDE
+ )
+ endif()"
+)
-add_custom_target(install-apidox
- COMMAND "./install_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}"
- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
##### configure checks ##########################