summaryrefslogtreecommitdiffstats
path: root/CMakeModules/GenDoc.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:55:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:55:11 +0000
commitcd07912073c951b4bbb871ed2653af1be2cfc714 (patch)
tree1073c2308492e6aea4c66cb7436ee92db2abfd42 /CMakeModules/GenDoc.cmake
parentInitial commit. (diff)
downloadlibyang2-519edde05ce4e4d0afbfc705ff24e78c997c3542.tar.xz
libyang2-519edde05ce4e4d0afbfc705ff24e78c997c3542.zip
Adding upstream version 2.1.30.upstream/2.1.30upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'CMakeModules/GenDoc.cmake')
-rw-r--r--CMakeModules/GenDoc.cmake28
1 files changed, 28 insertions, 0 deletions
diff --git a/CMakeModules/GenDoc.cmake b/CMakeModules/GenDoc.cmake
new file mode 100644
index 0000000..ee879d0
--- /dev/null
+++ b/CMakeModules/GenDoc.cmake
@@ -0,0 +1,28 @@
+# Prepare building doxygen documentation
+macro(GEN_DOC INPUT_FILES PROJECT_VERSION PROJECT_DESCRIPTION DOC_LOGO)
+ find_package(Doxygen)
+ if(DOXYGEN_FOUND)
+ find_program(DOT_PATH dot PATH_SUFFIXES graphviz2.38/bin graphviz/bin)
+ if(DOT_PATH)
+ set(HAVE_DOT "YES")
+ else()
+ set(HAVE_DOT "NO")
+ message(AUTHOR_WARNING "Doxygen: to generate UML diagrams please install graphviz")
+ endif()
+
+ # target doc
+ add_custom_target(doc
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+ # generate list with spaces as separators
+ string(REPLACE ";" " " DOXY_INPUT "${INPUT_FILES}")
+
+ # make other arguments into variables
+ set(PROJECT_VERSION ${PROJECT_VERSION})
+ set(PROJECT_DESCRIPTION ${PROJECT_DESCRIPTION})
+ set(DOC_LOGO ${DOC_LOGO})
+
+ configure_file(Doxyfile.in Doxyfile)
+ endif()
+endmacro()