Skip to content
Snippets Groups Projects

CMakeLists: add cmake target to build Doxygen docs

Merged Francesco Pham requested to merge mrfrank/eddie:doxygen_cmake into main
All threads resolved!
1 file
+ 21
1
Compare changes
  • Side-by-side
  • Inline
+ 21
1
@@ -6,4 +6,24 @@ enable_testing()
@@ -6,4 +6,24 @@ enable_testing()
set(VERSION_MAJOR 0)
set(VERSION_MAJOR 0)
set(VERSION_MINOR 1)
set(VERSION_MINOR 1)
add_subdirectory(linux)
add_subdirectory(linux)
\ No newline at end of file
 
# indicating the documentation build as an option and set it to ON by default
 
option(BUILD_DOC "Build documentation" ON)
 
 
# check if Doxygen is installed
 
find_package(Doxygen)
 
if (DOXYGEN_FOUND AND BUILD_DOC)
 
set(DOXYFILE ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile)
 
 
message("Doxygen build started")
 
 
# the option ALL which allows to build the docs together with the application
 
add_custom_target( doc_doxygen ALL
 
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
 
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 
COMMENT "Generating API documentation with Doxygen"
 
VERBATIM )
 
elseif (BUILD_DOC)
 
message("If you want API documentation to be generated, Doxygen needs to be installed.")
 
endif (DOXYGEN_FOUND AND BUILD_DOC)
Loading