summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-05-23 17:03:59 +0200
committerSlávek Banko <slavek.banko@axis.cz>2021-05-24 11:53:19 +0200
commitea2ac46a8ec6d15f48d7fa2201d7439033212604 (patch)
tree0ef7fdd1c586d08ec352741494e641395bd7ed25
parentd6003aeccd2ac47b95ac7629fbd1eb7740f37371 (diff)
downloadtdemultimedia-ea2ac46a8ec6d15f48d7fa2201d7439033212604.tar.gz
tdemultimedia-ea2ac46a8ec6d15f48d7fa2201d7439033212604.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 f818ae8cb02e60699c13c7e8481b68d9f55070e9) Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--CMakeLists.txt41
1 files changed, 35 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1be1d7ef..cc5907f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -159,10 +159,39 @@ configure_file( config.h.cmake config.h @ONLY )
##### 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
+)
-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()"
+)