summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJürgen Doser <jurgen.doser@gmail.com>2013-01-30 18:21:32 +0100
committerShadowNinja <shadowninja@minetest.net>2014-12-12 14:59:57 -0500
commit83830e8682de23840675a35daa386fa2820fbb7d (patch)
treee3ad73b461f1093c7f6d40969ef45056fa9083d5 /CMakeLists.txt
parent8066743a8390b22cf515aaced0280ddb64b69cb1 (diff)
downloadminetest-83830e8682de23840675a35daa386fa2820fbb7d.tar.gz
minetest-83830e8682de23840675a35daa386fa2820fbb7d.tar.bz2
minetest-83830e8682de23840675a35daa386fa2820fbb7d.zip
Add basic support for generating API documentation using Doxygen
If CMake is run and Doxygen is found, add a make target called "doc", which builds API documention in doc/html. This target is not included in the default "all" target, you have to explicitly run "make doc" to generate the documentation. If graphviz is installed, in particular, if the "dot" binary is found, doxygen is configured to generate various kinds of diagrams. Note that due to this, the first run of doxygen can take a while.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e234eedf..6bfd4c911 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -229,3 +229,14 @@ endif()
include(CPack)
+# Add a target to generate API documentation with Doxygen
+find_package(Doxygen)
+if(DOXYGEN_FOUND)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
+ add_custom_target(doc
+ ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
+ COMMENT "Generating API documentation with Doxygen" VERBATIM
+ )
+endif(DOXYGEN_FOUND)
+