diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2012-12-11 09:50:02 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2012-12-11 09:50:02 (GMT) |
commit | 0fa63991ea461b754f51726e6763ade6410bdbc0 (patch) | |
tree | 0d73a2535b03ef7d42c4dc37506fb6743c80ae4e /CMakeLists.txt | |
parent | d7cf13f1bec41d95b57b8980df84cac73c83f053 (diff) |
Switch to doxygen for documentation. Must be requested explicitly when running cmake using -DBUILD_DOCUMENTATION=ON
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 19 |
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() |