From 7255b14540d102c98b2b9e0e65d01991d134d0e7 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 27 Jul 2024 19:14:47 +0200 Subject: [PATCH 1/2] exclude ${PROJECT_NAME}-doc from ALL it is already called in install phase if INSTALL_DOCUMATION is set except when MSVC --- doxygen.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doxygen.cmake b/doxygen.cmake index 74db9b4f5..3989f9826 100644 --- a/doxygen.cmake +++ b/doxygen.cmake @@ -518,18 +518,22 @@ macro(_SETUP_PROJECT_DOCUMENTATION) endif(DOXYGEN_DOT_FOUND) # Teach CMake how to generate the documentation. - if(NOT TARGET doc) - add_custom_target(doc ALL COMMENT "Generating Doxygen documentation") - endif() if(MSVC) # FIXME: it is impossible to trigger documentation installation at # install, so put the target in ALL instead. + if(NOT TARGET doc) + add_custom_target(doc ALL COMMENT "Generating Doxygen documentation") + endif() add_custom_target( ${PROJECT_NAME}-doc COMMAND ${DOXYGEN_EXECUTABLE} ${JRL_CMAKEMODULE_DOXYFILE_PATH} WORKING_DIRECTORY doc COMMENT "Generating Doxygen documentation") else(MSVC) + if(NOT TARGET doc) + add_custom_target(doc COMMENT "Generating Doxygen documentation") + endif() + add_custom_target( ${PROJECT_NAME}-doc COMMAND ${DOXYGEN_EXECUTABLE} ${JRL_CMAKEMODULE_DOXYFILE_PATH} @@ -537,7 +541,7 @@ macro(_SETUP_PROJECT_DOCUMENTATION) COMMENT "Generating Doxygen documentation") if(INSTALL_DOCUMENTATION) - install(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_MAKE_PROGRAM} doc)") + install(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_MAKE_PROGRAM} ${PROJECT_NAME}-doc)") endif(INSTALL_DOCUMENTATION) endif(MSVC) add_dependencies(doc ${PROJECT_NAME}-doc) From 5f9b31ac21ad8ece333b7bfae90bc8a4f60aa9c8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 27 Jul 2024 17:51:55 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doxygen.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doxygen.cmake b/doxygen.cmake index 3989f9826..cebab7824 100644 --- a/doxygen.cmake +++ b/doxygen.cmake @@ -541,7 +541,9 @@ macro(_SETUP_PROJECT_DOCUMENTATION) COMMENT "Generating Doxygen documentation") if(INSTALL_DOCUMENTATION) - install(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_MAKE_PROGRAM} ${PROJECT_NAME}-doc)") + install( + CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_MAKE_PROGRAM} ${PROJECT_NAME}-doc)" + ) endif(INSTALL_DOCUMENTATION) endif(MSVC) add_dependencies(doc ${PROJECT_NAME}-doc)