diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2021-05-23 17:05:05 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-05-24 02:12:24 +0200 |
commit | 67411739947fe0bf9e71a6cd7aa92c6cfac6c207 (patch) | |
tree | 9802b59aef0f42dceec392b4e07753025b519406 | |
parent | 3a01fa0b5f84ff5ad1668cb05814733788697c49 (diff) | |
download | tdegames-67411739947fe0bf9e71a6cd7aa92c6cfac6c207.tar.gz tdegames-67411739947fe0bf9e71a6cd7aa92c6cfac6c207.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>
-rw-r--r-- | CMakeLists.txt | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cdf8a0f9..9ae4d7b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,14 +115,41 @@ endif( WITH_TEST ) ##### add apidox targets +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 "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/tqt3/doc/html" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/" + COMMAND ${CMAKE_ENV} + "TQTDOCDIR=/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/" + 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()" ) |