aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-12-22 22:12:27 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-12-22 22:12:27 +0000
commitc8b276a1fbf2669c1d77620c9d6aff0331ebed75 (patch)
treed075a9bb2d4fd1c566354dc81c3cb5de2941218c /CMakeLists.txt
parentfb8197839c0bebc20fd68ee3f280da934c49c473 (diff)
downloadYAGE-c8b276a1fbf2669c1d77620c9d6aff0331ebed75.tar.gz
YAGE-c8b276a1fbf2669c1d77620c9d6aff0331ebed75.zip
Including doxygen in cmake
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt35
1 files changed, 33 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d480b31c..f2ec7120 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,9 @@ project(yage
VERSION 0.1.3.0
LANGUAGES CXX)
+option(YAGE_BUILD_TESTS "Build tests and ctest testing suite" ON)
+option(YAGE_BUILD_DOCS "Build documentation using Doxygen" ON)
+
# set standard
set(CMAKE_CXX_STANDARD 14)
@@ -52,6 +55,34 @@ target_link_libraries(yage
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/examples)
-if(YAGE_BUILD_TESTS)
+if(${YAGE_BUILD_TESTS})
+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)
-endif(YAGE_BUILD_TESTS)
+
+endif(${YAGE_BUILD_TESTS})
+
+if(${YAGE_BUILD_DOCS})
+
+ find_package(Doxygen)
+
+ if(DOXYGEN_FOUND)
+
+ set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in)
+ set(DOXYGEN_OUT ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile)
+
+ configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
+ message("-- Configured Doxygen files")
+
+ add_custom_target(doc_doxygen ALL
+ COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} >/dev/null
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Generating API documentation with Doxygen")
+
+ else(DOXYGEN_FOUND)
+
+ message("Doxygen needs to be installed to generate the documentation.")
+
+ endif(DOXYGEN_FOUND)
+
+endif(${YAGE_BUILD_DOCS})
+