summaryrefslogtreecommitdiffstats
path: root/lib/doc/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'lib/doc/CMakeLists.txt')
-rwxr-xr-xlib/doc/CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/doc/CMakeLists.txt b/lib/doc/CMakeLists.txt
new file mode 100755
index 000000000..cf022dc52
--- /dev/null
+++ b/lib/doc/CMakeLists.txt
@@ -0,0 +1,23 @@
+# add a target to generate API documentation with Doxygen
+find_package(Doxygen)
+option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
+
+if(BUILD_DOCUMENTATION)
+ if(NOT DOXYGEN_FOUND)
+ message(FATAL_ERROR "Doxygen is needed to build the documentation.")
+ endif()
+
+ set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
+ set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+
+ configure_file(${doxyfile_in} ${doxyfile} @ONLY)
+
+ add_custom_target(doc
+ COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Generating API documentation with Doxygen"
+ VERBATIM)
+
+# FIXME MS : wrong install path
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
+endif()