Skip to content

Commit

Permalink
Fix #1231, Doxygen strip path and expose common config
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Mar 16, 2022
1 parent a173f30 commit 8a98ac2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
19 changes: 12 additions & 7 deletions docs/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
########################################################

#
# This CMake script currently defines a top-level target "apiguide"
# This CMake script currently defines a top-level target "osal-apiguide"
# to build the OSAL API documentation. This may be invoked either
# from the main OSAL CMakeLists.txt as a subdirectory (useful in the
# case of a self-contained/standalone build) or by a separate script
Expand Down Expand Up @@ -61,14 +61,19 @@ foreach(DIR ${OSAL_API_INCLUDE_DIRECTORIES})
endforeach()

file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/osal-apiguide-warnings.log OSAL_NATIVE_LOGFILE)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/osal-common.doxyfile OSAL_NATIVE_COMMON_CFGFILE)
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)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/default-settings.doxyfile OSAL_NATIVE_DEFAULT_SETTINGS)

# Add a top level source directory if not defined
if (NOT DEFINED MISSION_SOURCE_DIR)
set(MISSION_SOURCE_DIR ${CMAKE_SOURCE_DIR})
endif()

# generate the configuration files
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/osal-common.doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/osal-common.doxyfile
${CMAKE_BINARY_DIR}/docs/osal-common.doxyfile
@ONLY
)

Expand All @@ -78,14 +83,14 @@ configure_file(
@ONLY
)

add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/apiguide/html/index.html"
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/index.html"
COMMAND doxygen ${OSAL_NATIVE_APIGUIDE_CFGFILE}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/osal-apiguide.doxyfile ${CMAKE_CURRENT_BINARY_DIR}/osal-common.doxyfile
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/osal-apiguide.doxyfile ${CMAKE_BINARY_DIR}/docs/osal-common.doxyfile
${OSAL_DOCFILE_LIST} ${OSAL_DOC_DEPENDENCY_LIST}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)

add_custom_target(osal-apiguide
COMMAND echo "OSAL API Guide: file://${CMAKE_CURRENT_BINARY_DIR}/apiguide/html/index.html"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/apiguide/html/index.html"
COMMAND echo "OSAL API Guide: file://${CMAKE_CURRENT_BINARY_DIR}/html/index.html"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/index.html"
)
6 changes: 2 additions & 4 deletions docs/src/osal-apiguide.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
# Doxygen Configuration options to generate the "OSAL API Guide"
#---------------------------------------------------------------------------

# Common definitions, some of which are extended or overridden here.
# Common definitions, can be overridden here
@INCLUDE = @OSAL_NATIVE_COMMON_CFGFILE@
PROJECT_NAME = "OSAL User's Guide"
OUTPUT_DIRECTORY = apiguide

# output the warnings to a separate file
PROJECT_NAME = "OSAL User's Guide"
WARN_LOGFILE = @OSAL_NATIVE_LOGFILE@
5 changes: 4 additions & 1 deletion docs/src/osal-common.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
# Allow overrides
@INCLUDE_PATH = @MISSION_SOURCE_DIR@

# Default settings from cFE
# Default settings
@INCLUDE = @OSAL_NATIVE_DEFAULT_SETTINGS@

# Include any passed in predefines
PREDEFINED += @OSALDOC_PREDEFINED@

# Minimum set of source files (includes *.dox, followed by public headers)
INPUT += @OSAL_NATIVE_APIGUIDE_SOURCEFILES@

# Strip source dir from path
STRIP_FROM_PATH += @MISSION_SOURCE_DIR@

0 comments on commit 8a98ac2

Please sign in to comment.