summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07e1107..ba7b366 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,3 +7,22 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
add_subdirectory(src)
+
+#-- Add an Option to toggle the generation of the API documentation
+option(BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF)
+if(BUILD_DOCUMENTATION)
+ FIND_PACKAGE(Doxygen)
+ if (NOT DOXYGEN_FOUND)
+ message(FATAL_ERROR
+ "Doxygen is needed to build the documentation. Please install it correctly")
+ endif()
+ #-- Configure the Template Doxyfile for our specific project
+ configure_file(Doxyfile.in
+ ${PROJECT_BINARY_DIR}/Doxyfile @ONLY IMMEDIATE)
+ #-- Add a custom target to run Doxygen when ever the project is built
+ add_custom_target (Docs ALL
+ COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
+ SOURCES ${PROJECT_BINARY_DIR}/Doxyfile)
+ # IF you do NOT want the documentation to be generated EVERY time you build the project
+ # then leave out the 'ALL' keyword from the above command.
+endif()
contact: Jan Huwald // Impressum