summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-05-23 15:31:52 +0200
committerSlávek Banko <slavek.banko@axis.cz>2021-05-24 11:48:47 +0200
commita3c7506b60f99df2cef036d23bcce70ab6b9a08c (patch)
tree7746e669c34ce2de9567f63dea97b41870f9f426
parentc5cd19261759ce3257c79599197152199f3ab745 (diff)
downloadtdelibs-a3c7506b60f99df2cef036d23bcce70ab6b9a08c.tar.gz
tdelibs-a3c7506b60f99df2cef036d23bcce70ab6b9a08c.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 da3e395af57e3e79eb7acc10ad640a10e4e8e202) Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--CMakeLists.txt40
1 files changed, 34 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab4faa405..8520df969 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,13 +52,41 @@ list( APPEND TDECORE_LIBRARY_DIRS ${TQT_LIBRARY_DIRS} )
##### add apidox targets ############
-add_custom_target(apidox
- COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/tqt3/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"
+ ${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 "./install_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}"
- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
+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()"
+)
##### user requested options ####################