summaryrefslogtreecommitdiffstats
path: root/docs/CMakeLists.txt
blob: 15b772646efe3d65d091d7aa42ca7568ef8f1f16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
############################################################
# Build documentation
############################################################

# see https://tty1.net/blog/2014/cmake-doxygen_en.html
find_package(Doxygen)
option(BUILD_DOCS "Create API documentation (requires doxygen)" ${DOXYGEN_FOUND})

if(BUILD_DOCS)
	configure_file(
		${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in 
		${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 
		@ONLY)

	add_custom_target(docs
	    COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
	    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
	    COMMENT "Generating API documentation with Doxygen"
	    VERBATIM)
	
	file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html)
	
	install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc/uscxml)
endif()