diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-23 09:41:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-23 09:41:28 +0000 |
commit | 76ffd5ce84e4adb412833c8186fc6b26b656947f (patch) | |
tree | 11da7c12c05e9d2a85ec40022d43a970184bb867 /CMakeModules/GenDoc.cmake | |
parent | Initial commit. (diff) | |
download | libyang3-76ffd5ce84e4adb412833c8186fc6b26b656947f.tar.xz libyang3-76ffd5ce84e4adb412833c8186fc6b26b656947f.zip |
Adding upstream version 3.1.0.upstream/3.1.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'CMakeModules/GenDoc.cmake')
-rw-r--r-- | CMakeModules/GenDoc.cmake | 28 |
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() |