Skip to content

Commit

Permalink
Add documentation target to CMake configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
joaocandre committed Feb 16, 2024
1 parent 291063f commit 86b0e27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ if("${Boost_FIND_VERSION}" VERSION_LESS "1.66.1")
endif()

## Doxygen
find_package(Doxygen)
if (${PROJECT_NAME}_GEN_DOC)
find_package(Doxygen REQUIRED)
endif()

if (${PROJECT_NAME}_ENABLE_PLOT_UTILS)
set (matplotlib_cpp_BUILD_EXAMPLES OFF CACHE INTERNAL "Turn off examples")
Expand Down Expand Up @@ -134,7 +136,7 @@ endif()

########### API documentation

if(${DOXYGEN_FOUND} AND ${PROJECT_NAME}_GEN_DOC)
if (${${PROJECT_NAME}_GEN_DOC})
# cf. https://vicrucann.github.io/tutorials/quick-cmake-doxygen/

# set input and output files
Expand All @@ -146,7 +148,7 @@ if(${DOXYGEN_FOUND} AND ${PROJECT_NAME}_GEN_DOC)
message(STATUS "Building documentation (doxygen) for target ${PROJECT_NAME}")

# note the option ALL which allows to build the docs together with the application
add_custom_target(doc_doxygen ALL
add_custom_target(${PROJECT_NAME}_doc ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
Expand Down
3 changes: 3 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

<buildtool_depend>cmake</buildtool_depend>

<build_export_depend>tinyxml2</build_export_depend>
<build_export_depend>matplotlib_cpp</build_export_depend>

<export>
<build_type>cmake</build_type>
</export>
Expand Down

0 comments on commit 86b0e27

Please sign in to comment.