From 89e2e38511688264c5edb8ed19c7244dbf47cdd4 Mon Sep 17 00:00:00 2001
From: Tobias Frisch <tfrisch@uni-koblenz.de>
Date: Tue, 4 May 2021 14:07:26 +0200
Subject: [PATCH] [#20] Added Doxygen target in cmake

Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de>
---
 .gitignore               |  2 --
 CMakeLists.txt           |  2 ++
 config/ext/Doxygen.cmake | 14 ++++++++++++++
 doc/.gitignore           |  2 ++
 4 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100644 config/ext/Doxygen.cmake
 create mode 100644 doc/.gitignore

diff --git a/.gitignore b/.gitignore
index c2180cd1..d7d4599d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,5 +8,3 @@
 build/
 cmake-build-debug/
 cmake-build-release/
-
-doc/
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 820fea55..cfe411c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,3 +57,5 @@ target_include_directories(vkcv SYSTEM BEFORE PRIVATE ${vkcv_includes})
 target_link_libraries(vkcv ${vkcv_libraries})
 
 add_subdirectory(projects)
+
+include(${vkcv_config}/ext/Doxygen.cmake)
diff --git a/config/ext/Doxygen.cmake b/config/ext/Doxygen.cmake
new file mode 100644
index 00000000..b711ac4b
--- /dev/null
+++ b/config/ext/Doxygen.cmake
@@ -0,0 +1,14 @@
+
+# check if Doxygen is installed
+find_package(Doxygen)
+
+if (DOXYGEN_FOUND)
+	# note the option ALL which allows to build the docs together with the application
+	add_custom_target( doc_doxygen ALL
+			COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Doxyfile
+			WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+			COMMENT "Generating API documentation with Doxygen"
+			VERBATIM )
+else (DOXYGEN_FOUND)
+	message(WARNING "Doxygen need to be installed to generate the doxygen documentation")
+endif (DOXYGEN_FOUND)
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 00000000..67897178
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,2 @@
+html/
+latex/
-- 
GitLab