From 2107b1e821335dfe66e7c8ed615546e6f4a03032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 23 May 2021 17:07:16 +0200 Subject: Use CMake rules instead of calling external shell scripts generate_apidox and install_apidox from the cmake submodule folder. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After generating apidox, links pointing to build directory are fixed. Signed-off-by: Slávek Banko --- CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 95dd0c58..2b19ac8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,13 +44,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/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} + "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 ${CMAKE_COMMAND} -E echo Apidox installed in ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs +) -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/") +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()" +) ##### build tools ############################### -- cgit v1.2.1