summary refs log tree commit diff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-02 18:39:49 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-02 18:39:49 +0300
commita8e82ba284458079d60626af09368670451d4a33 (patch)
treee45cb46b01ec1a9ed92106c014c9e527714d581d /CMakeLists.txt
parentAdd shortcuts for chat-only & Room List-only views (diff)
downloadnheko-a8e82ba284458079d60626af09368670451d4a33.tar.xz
Add build target for doxygen
Includes documentation & dependency/call graphs
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e45fa0ed..51ec600f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,26 @@ if(NOT MSVC AND NOT APPLE)
   find_package(Threads REQUIRED)
 endif()
 
+if (BUILD_DOCS)
+    find_package(Doxygen)
+
+    if (DOXYGEN_FOUND)
+        set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Doxyfile.in)
+        set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+
+        configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT})
+
+        add_custom_target(docs ALL
+            COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
+            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+            COMMENT "Generating API documentation with Doxygen"
+            VERBATIM )
+    else (DOXYGEN_FOUND)
+        message("Doxygen need to be installed to generate the doxygen documentation")
+    endif (DOXYGEN_FOUND)
+endif()
+
+
 #
 # LMDB
 #