-
Notifications
You must be signed in to change notification settings - Fork 0
/
doxygen.cmake
29 lines (26 loc) · 955 Bytes
/
doxygen.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
if (CMAKE_BUILD_TYPE MATCHES "^[Rr]el" OR CMAKE_BUILD_TYPE MATCHES "^[Mm]in")
option(BUILD_DOC "Build documentation" ON)
else ()
option(BUILD_DOC "Build documentation" OFF)
endif ()
if (BUILD_DOC)
# Files used by doxygen
set(DOXYGEN_IN "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in")
set(DOXYGEN_OUT "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
configure_file("${DOXYGEN_IN}" "${DOXYGEN_OUT}" @ONLY)
find_package(Doxygen)
if (Doxygen_FOUND)
# note the option ALL which allows to build the docs together with the application
add_custom_target(doxygen ALL
COMMAND "${DOXYGEN_EXECUTABLE}" "${DOXYGEN_OUT}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doxygen/html/"
DESTINATION doc
)
else (Doxygen_FOUND)
message("Doxygen is needed to generate the doxygen documentation.")
endif (Doxygen_FOUND)
endif (BUILD_DOC)