2019-08-17 08:19:08 +00:00
|
|
|
set(DOXYGEN_FOUND AUTO CACHE STRING "Enable Doxygen documentation generator")
|
|
|
|
set_property(CACHE DOXYGEN_FOUND PROPERTY STRINGS ON OFF AUTO)
|
|
|
|
|
|
|
|
find_package(Doxygen)
|
|
|
|
if (DOXYGEN_FOUND)
|
|
|
|
set(DOXYGEN_FOUND ON CACHE FORCE)
|
|
|
|
else()
|
|
|
|
set(DOXYGEN_FOUND OFF CACHE FORCE)
|
|
|
|
endif()
|
2019-08-17 03:04:04 +00:00
|
|
|
|
|
|
|
|
2019-08-17 08:19:08 +00:00
|
|
|
function(add_doxygen_target)
|
|
|
|
if (DOXYGEN_FOUND)
|
2019-08-17 03:04:04 +00:00
|
|
|
set(options)
|
|
|
|
set(oneValueArgs TARGET_NAME IN OUT)
|
|
|
|
set(multiValueArgs)
|
|
|
|
|
|
|
|
cmake_parse_arguments(_DOXYGEN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
|
|
|
configure_file(${_DOXYGEN_IN} ${_DOXYGEN_OUT} @ONLY)
|
|
|
|
message("Doxygen build started")
|
|
|
|
|
2019-08-17 03:53:59 +00:00
|
|
|
add_custom_target(${_DOXYGEN_TARGET_NAME} VERBATIM
|
2019-08-17 03:04:04 +00:00
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT "Generating API documentation with Doxygen"
|
2019-08-17 08:19:08 +00:00
|
|
|
VERBATIM)
|
|
|
|
else()
|
|
|
|
add_custom_target(${_DOXYGEN_TARGET_NAME} VERBATIM
|
|
|
|
COMMENT "Doxygen is not found. Skipping target ${_BREATHE_TARGET_NAME} build")
|
2019-08-17 03:04:04 +00:00
|
|
|
endif()
|
|
|
|
endfunction()
|