Skip to content

Commit b480a04

Browse files
committedSep 6, 2018
Minimal Doxygen setup
1 parent 01bc9e8 commit b480a04

File tree

2 files changed

+2451
-0
lines changed

2 files changed

+2451
-0
lines changed
 

‎CMakeLists.txt

+24
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,27 @@ target_link_libraries(
124124
${GEOS_LIBRARY}
125125
)
126126

127+
# Doxygen configuration from https://vicrucann.github.io/tutorials/quick-cmake-doxygen/
128+
# first we can indicate the documentation build as an option and set it to ON by default
129+
option(BUILD_DOC "Build documentation" ON)
130+
131+
# check if Doxygen is installed
132+
find_package(Doxygen)
133+
if (DOXYGEN_FOUND)
134+
# set input and output files
135+
set(DOXYGEN_IN ${CMAKE_SOURCE_DIR}/docs/Doxyfile.in)
136+
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
137+
138+
# request to configure the file
139+
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
140+
message("Doxygen build started")
141+
142+
# note the option ALL which allows to build the docs together with the application
143+
add_custom_target( doc_doxygen ALL
144+
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
145+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
146+
COMMENT "Generating API documentation with Doxygen"
147+
VERBATIM )
148+
else (DOXYGEN_FOUND)
149+
message("Doxygen need to be installed to generate the doxygen documentation")
150+
endif (DOXYGEN_FOUND)

0 commit comments

Comments
 (0)