Skip to content

Instantly share code, notes, and snippets.

@smrfeld
Created June 24, 2020 22:15
Show Gist options
  • Save smrfeld/4938ebcbe49cf3671de2fd7257da75b7 to your computer and use it in GitHub Desktop.
Save smrfeld/4938ebcbe49cf3671de2fd7257da75b7 to your computer and use it in GitHub Desktop.
CMake Doxygen
# Doxygen
# look for Doxygen package
find_package(Doxygen)
if (DOXYGEN_FOUND)
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs_doxygen/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.out)
# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
# Note: do not put "ALL" - this builds docs together with application EVERY TIME!
add_custom_target( docs
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
@david-alvarez-rosa
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment