diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2021-05-23 15:51:37 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-05-24 11:50:55 +0200 |
commit | a9ca57c1b8b2630387be46842c912d30c296ff4d (patch) | |
tree | 12db58623560f4a4c5b0db5cfef071169add74b0 | |
parent | 755a722f046b26dfdf0fb7a34a8065cf238ffbee (diff) | |
download | tdebase-a9ca57c1b8b2630387be46842c912d30c296ff4d.tar.gz tdebase-a9ca57c1b8b2630387be46842c912d30c296ff4d.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 83c3db4678ef2ae540e0ebd68c0ca4a951bd219a)
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | CMakeLists.txt | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index dce45013c..890022789 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,13 +50,42 @@ tde_setup_paths( ) ##### 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 "./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()" +) ##### optional stuff ############################ |