From 2b30fe009495789ebbb3a23934aecadaa88c2c00 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 23 Nov 2022 14:05:53 -0500 Subject: [PATCH] Fix #1339, add doc-prebuild dependency When building as part of CFE/CFS, register the osal header list file (osal-public-api.doxyfile) as a dependency of the doc-prebuild abstract target. This way, CFE and any other CFS apps that refer to the OSAL headers in their documentation can easily ensure that this (and any other file produced by other modules) exist prior to attempting to run doxygen. --- docs/src/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/src/CMakeLists.txt b/docs/src/CMakeLists.txt index 0637529bc..c257dc0b0 100644 --- a/docs/src/CMakeLists.txt +++ b/docs/src/CMakeLists.txt @@ -68,17 +68,25 @@ endif () # Generate the list of actual header files from the directories specified. This is done # as a target that runs a separate script such that generator expressions can be evaluated. # This is done as a custom target such that it runs and gets updated every build -add_custom_target(osal_public_api_headerlist +add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/docs/osal-public-api.doxyfile" COMMAND ${CMAKE_COMMAND} -DINCLUDE_DIRECTORIES="${OSAL_API_INCLUDE_DIRECTORIES}" -DCOMPILE_DEFINITIONS="${OSAL_API_COMPILE_DEFINITIONS}" -DINPUT_TEMPLATE="${CMAKE_CURRENT_SOURCE_DIR}/osal-public-api.doxyfile.in" -DOUTPUT_FILE="${CMAKE_BINARY_DIR}/docs/osal-public-api.doxyfile" -P "${CMAKE_CURRENT_SOURCE_DIR}/generate-public-api-doxyfile.cmake" - BYPRODUCTS "${CMAKE_BINARY_DIR}/docs/osal-public-api.doxyfile" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) +add_custom_target(osal_public_api_headerlist + DEPENDS "${CMAKE_BINARY_DIR}/docs/osal-public-api.doxyfile") + +# if building as part of CFS, then generate the doxygen header list as part of the prebuild step +# The "doc-prebuild" target is defined by the CFS build, and thus will not exist if building standalone +if (TARGET doc-prebuild) + add_dependencies(doc-prebuild osal_public_api_headerlist) +endif () + file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/osal-apiguide-warnings.log OSAL_NATIVE_LOGFILE) file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR}/docs/osal-common.doxyfile OSAL_NATIVE_COMMON_CFGFILE) file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/osal-apiguide.doxyfile OSAL_NATIVE_APIGUIDE_CFGFILE)