From cb82630665095d7f444f7e456e0becea27430fcc Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 4 Apr 2017 01:00:17 +0200 Subject: [PATCH] Add general target for generating API doc --- README.md | 2 +- cmake/modules/Doxygen.cmake | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index abb67c5..4e9eb05 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ cd "path/to/build/directory" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/final/install/location" "path/to/projectdirectory" make make check # build and run unit tests (optional) -make c++utilities_apidoc # build API documentation (optional) +make apidoc # build API documentation (optional) make DESTDIR="/temporary/install/location" install ``` diff --git a/cmake/modules/Doxygen.cmake b/cmake/modules/Doxygen.cmake index bc312cd..32746c9 100644 --- a/cmake/modules/Doxygen.cmake +++ b/cmake/modules/Doxygen.cmake @@ -51,10 +51,14 @@ if(NOT NO_DOXYGEN) ) # add target for generating API documentation - add_custom_target(${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}_apidoc + add_custom_target("${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}_apidoc" COMMAND "${DOXYGEN_BIN}" "${CMAKE_CURRENT_BINARY_DIR}/doxygen.config" SOURCES ${DOXY_INPUT_FILES} ) + if(NOT TARGET apidoc) + add_custom_target(apidoc) + endif() + add_dependencies(apidoc "${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}_apidoc") # add install target for API documentation install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/api-doc" @@ -62,7 +66,6 @@ if(NOT NO_DOXYGEN) COMPONENT api-doc OPTIONAL ) - if(NOT TARGET install-api-doc) add_custom_target(install-api-doc COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=api-doc -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"