Skip to content

Commit

Permalink
Merge pull request #1612 from jphickey/fix-1378-1589-doxygen-cleanup
Browse files Browse the repository at this point in the history
Fix #1378, 1589, doxygen cleanup
  • Loading branch information
jphickey committed Jun 15, 2021
2 parents 5d2288a + c67f217 commit e54e908
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 68 deletions.
20 changes: 5 additions & 15 deletions cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -611,21 +611,11 @@ function(process_arch SYSVAR)
# This can help with debugging if things go wrong.
message(STATUS "PSP Selection: ${CFE_SYSTEM_PSPNAME}")

# Append the PSP and OSAL selections to the Doxyfile so it will be included
# in the generated documentation automatically.
# Also extract the "-D" options within CFLAGS and inform Doxygen about these
string(REGEX MATCHALL "-D[A-Za-z0-9_=]+" DOXYGEN_DEFINED_MACROS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE "-D" " " DOXYGEN_DEFINED_MACROS "${DOXYGEN_DEFINED_MACROS}")
file(APPEND "${MISSION_BINARY_DIR}/docs/mission-content.doxyfile"
"PREDEFINED += ${DOXYGEN_DEFINED_MACROS}\n"
"INPUT += ${MISSION_SOURCE_DIR}/osal/src/os/${OSAL_SYSTEM_OSTYPE}\n"
"INPUT += ${MISSION_SOURCE_DIR}/psp/fsw/${CFE_SYSTEM_PSPNAME}\n"
"INPUT += ${CMAKE_BINARY_DIR}/inc")

# Append to usersguide.doxyfile
file(APPEND "${MISSION_BINARY_DIR}/docs/cfe-usersguide.doxyfile"
"INPUT += ${MISSION_SOURCE_DIR}/psp/fsw/${CFE_SYSTEM_PSPNAME}/src\n"
"INPUT += ${CMAKE_BINARY_DIR}/inc")
# Create a documentation content file, with any system-specific doxygen info
# this is done here in arch_build where the CFE_SYSTEM_PSPNAME is known
file(WRITE "${MISSION_BINARY_DIR}/docs/tgtsystem-content-${SYSVAR}.doxyfile"
"INPUT += ${CMAKE_BINARY_DIR}/inc\n"
)

# The PSP and/or OSAL should have defined where to install the binaries.
# If not, just install them in /cf as a default (this can be modified
Expand Down
8 changes: 6 additions & 2 deletions cmake/cfe-common.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Project related configuration options, shared for all cFE doxygen outputs
#---------------------------------------------------------------------------
@INCLUDE_PATH = @MISSION_SOURCE_DIR@
OUTPUT_DIRECTORY = .
ABBREVIATE_BRIEF = "The $name class " \
"The $name widget " \
"The $name file " \
Expand Down Expand Up @@ -55,7 +54,6 @@ GENERATE_DEPRECATEDLIST= YES
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
WARN_NO_PARAMDOC = YES
WARN_LOGFILE = @CMAKE_BINARY_DIR@/docs/warnings.log
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
Expand All @@ -77,6 +75,12 @@ INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfe_xref.dox
FILE_PATTERNS = *.c *.cpp *.cc *.C *.h *.hh *.hpp *.H *.dox *.md
RECURSIVE = YES
EXAMPLE_PATTERNS = *

# Exclude coverage tests, stubs and associated framework from the documentation
EXCLUDE_PATTERNS += "*/ut-stubs/*"
EXCLUDE_PATTERNS += "*/ut-coverage/*"
EXCLUDE_PATTERNS += "*/unit-test*/*"

#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions cmake/cfe-usersguide.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/main.dox
# Common definitions, some of which are extended or overridden here.
@INCLUDE = @MISSION_BINARY_DIR@/docs/cfe-common.doxyfile
PROJECT_NAME = "Core Flight Executive Users Guide"
OUTPUT_DIRECTORY = users_guide
OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/docs/users_guide
WARN_LOGFILE = @CMAKE_BINARY_DIR@/docs/cfe-usersguide-warnings.log
GENERATE_LATEX = YES

# For purposes of the user guide, reference the "stock" mission configuration
Expand All @@ -17,7 +18,6 @@ GENERATE_LATEX = YES
STRIP_FROM_PATH += @MISSION_SOURCE_DIR@/cfe/cmake/sample_defs
INPUT += @MISSION_SOURCE_DIR@/cfe/cmake/sample_defs

#PREDEFINED
PREDEFINED += @USERGUIDE_PREDEFINED@

# Bring in the cFE header files for the documentation of the various API calls
Expand Down
24 changes: 5 additions & 19 deletions cmake/mission-detaildesign.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,14 @@
@INCLUDE = @MISSION_BINARY_DIR@/docs/cfe-common.doxyfile
PROJECT_NAME = "@MISSION_NAME@"
PROJECT_BRIEF = "Core Flight System project built using \"@MISSIONCONFIG@\" configuration"
OUTPUT_DIRECTORY = detaildesign

INPUT += @MISSION_DEFS@ \
@MISSION_SOURCE_DIR@/osal/src/os/inc \
@MISSION_SOURCE_DIR@/osal/src/os/shared \
@MISSION_SOURCE_DIR@/psp/fsw/inc \
@MISSION_SOURCE_DIR@/psp/fsw/shared \
@MISSION_SOURCE_DIR@/cfe/modules/core_api/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/core_private/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/es/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/evs/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/fs/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/msg/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/resourceid/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/sb/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/sbr/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/tbl/fsw \
@MISSION_SOURCE_DIR@/cfe/modules/time/fsw
OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/docs/detaildesign
WARN_LOGFILE = @CMAKE_BINARY_DIR@/docs/detaildesign-warnings.log

INPUT += @MISSION_DEFS@
STRIP_FROM_PATH += @MISSION_DEFS@

#---------------------------------------------------------------------------
# The user content doxyfile contains paths to the mission-specific applications
#---------------------------------------------------------------------------
@INCLUDE = @CMAKE_BINARY_DIR@/docs/mission-content.doxyfile
@DETAILDESIGN_DOXYFILE_USER_CONTENT@
@TGTSYSTEM_DOXYFILE_USER_CONTENT@
77 changes: 47 additions & 30 deletions cmake/mission_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -241,36 +241,48 @@ function(prepare)
# If the user has provided a "Doxyfile" in their top level documentation directory,
# then assume they have also set PROJECT_NAME and PROJECT_BRIEF in that.
# Otherwise, generate reasonable strings for these values.
set(MISSION_DOXYFILE_USER_CONTENT)
set(DETAILDESIGN_DOXYFILE_USER_CONTENT)
if (EXISTS "${MISSION_SOURCE_DIR}/docs/Doxyfile")
list(APPEND MISSION_DOXYFILE_USER_CONTENT "@INCLUDE = ${MISSION_SOURCE_DIR}/docs/Doxyfile\n")
list(APPEND DETAILDESIGN_DOXYFILE_USER_CONTENT "@INCLUDE = ${MISSION_SOURCE_DIR}/docs/Doxyfile\n")
endif (EXISTS "${MISSION_SOURCE_DIR}/docs/Doxyfile")

# Add any detail design information from each app/module
foreach(APP ${MISSION_DEPS})
# OSAL is handled specially, as only part of it is used
if (NOT APP STREQUAL "osal")
if (EXISTS "${${APP}_MISSION_DIR}/docs/${APP}.doxyfile.in")
# If the module provides its own doxyfile, then include it directly
# This allows for app-specific fine-tuning of the sources, based on its own source tree
configure_file("${${APP}_MISSION_DIR}/docs/${APP}.doxyfile.in"
"${CMAKE_BINARY_DIR}/docs/${APP}.doxyfile")
list(APPEND MISSION_DOXYFILE_USER_CONTENT "@INCLUDE = ${CMAKE_BINARY_DIR}/docs/${APP}.doxyfile\n")
else()
# Otherwise just add this entire directory to the "INPUT" list
list(APPEND MISSION_DOXYFILE_USER_CONTENT "INPUT += ${${APP}_MISSION_DIR}\n")
endif()

set(APP_DOC_DIR "${${APP}_MISSION_DIR}/docs")

# Now add the app-specific documentation to the detail design input set.
# This depends on whether the app has provided any guidance on this.
# The "doxyfile.in" should provide specific directives for what to include. If
# not specified, then the entire app source tree will be used as a catch-all.
if (EXISTS "${APP_DOC_DIR}/${APP}-detaildesign.doxyfile.in")

# a "doxyfile.in" is a template that should be passed through configure_file()
# (which will expand any variable refs) then the result of this is included in the doxyfile
configure_file("${APP_DOC_DIR}/${APP}-detaildesign.doxyfile.in"
"${CMAKE_BINARY_DIR}/docs/${APP}-detaildesign.doxyfile")

list(APPEND DETAILDESIGN_DOXYFILE_USER_CONTENT "@INCLUDE = ${CMAKE_BINARY_DIR}/docs/${APP}-detaildesign.doxyfile\n")
else()

# Otherwise just add this entire directory to the "INPUT" list
list(APPEND DETAILDESIGN_DOXYFILE_USER_CONTENT "INPUT += ${${APP}_MISSION_DIR}\n")
endif()

endforeach()

# In all cases it is assumed to include the CFE documentation as well (could be configurable?)
file(WRITE "${CMAKE_BINARY_DIR}/docs/mission-content.doxyfile"
${MISSION_DOXYFILE_USER_CONTENT})
set(TGTSYSTEM_DOXYFILE_USER_CONTENT)
foreach(SYSVAR ${TGTSYS_LIST})
list(APPEND TGTSYSTEM_DOXYFILE_USER_CONTENT "@INCLUDE = ${CMAKE_BINARY_DIR}/docs/tgtsystem-content-${SYSVAR}.doxyfile\n")
endforeach()

configure_file("${CFE_SOURCE_DIR}/cmake/cfe-common.doxyfile.in"
"${CMAKE_BINARY_DIR}/docs/cfe-common.doxyfile")
# Create single/unified strings from the lists
string(CONCAT DETAILDESIGN_DOXYFILE_USER_CONTENT ${DETAILDESIGN_DOXYFILE_USER_CONTENT})
string(CONCAT TGTSYSTEM_DOXYFILE_USER_CONTENT ${TGTSYSTEM_DOXYFILE_USER_CONTENT})

configure_file("${CFE_SOURCE_DIR}/cmake/mission-detaildesign.doxyfile.in"
"${CMAKE_BINARY_DIR}/docs/mission-detaildesign.doxyfile")
configure_file("${CFE_SOURCE_DIR}/cmake/cfe-common.doxyfile.in"
"${CMAKE_BINARY_DIR}/docs/cfe-common.doxyfile"
@ONLY)

# Generate an "empty" osconfig.h file for doxygen purposes
# this does not have the actual user-defined values, but will
Expand All @@ -295,16 +307,21 @@ function(prepare)

string(REPLACE ";" " \\\n" MISSION_USERGUIDE_HEADERFILES "${MISSION_USERGUIDE_HEADERFILES}")

configure_file("${CFE_SOURCE_DIR}/cmake/cfe-usersguide.doxyfile.in"
"${CMAKE_BINARY_DIR}/docs/cfe-usersguide.doxyfile")

add_custom_target(mission-doc
doxygen mission-detaildesign.doxyfile
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/docs/detaildesign")
configure_file("${CFE_SOURCE_DIR}/cmake/mission-detaildesign.doxyfile.in"
"${CMAKE_BINARY_DIR}/docs/detaildesign/Doxyfile"
@ONLY)
add_custom_target(mission-doc doxygen
COMMAND echo "Detail Design: file://${CMAKE_BINARY_DIR}/docs/detaildesign/html/index.html"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs/detaildesign")

add_custom_target(cfe-usersguide
doxygen cfe-usersguide.doxyfile
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/docs/users_guide")
configure_file("${CFE_SOURCE_DIR}/cmake/cfe-usersguide.doxyfile.in"
"${CMAKE_BINARY_DIR}/docs/users_guide/Doxyfile"
@ONLY)
add_custom_target(cfe-usersguide doxygen
COMMAND echo "Users Guide: file://${CMAKE_BINARY_DIR}/docs/users_guide/html/index.html"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs/users_guide")

# OSAL API GUIDE include PUBLIC API
set(OSAL_API_INCLUDE_DIRECTORIES
Expand Down

0 comments on commit e54e908

Please sign in to comment.