From 122255bb61df9e28242325ccc918a5f1eb944f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20F=2E=20Aasen?= Date: Tue, 12 Jul 2022 07:29:02 +0200 Subject: [PATCH 1/2] docs: Create graphs when generating Doxygen documentation If we enable documentation and CMake finds Doxygen and 'dot' in path, diagrams and graphs will be created. CMake searches for 'dot' at the same time as Doxygen. 'dot' is a tool found in graphviz. --- CMakeLists.txt | 1 + docs/CMakeLists.txt | 6 ++++++ docs/Doxyfile.in | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61c57d7a3e1..16a471f821c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -469,6 +469,7 @@ message(STATUS " ") message(STATUS "Documentation:") message(STATUS "enabled: ${ENABLE_DOCS}") message(STATUS "doxygen: ${DOXYGEN_EXECUTABLE}") +message(STATUS "dot (graphviz): ${DOXYGEN_DOT_EXECUTABLE}") message(STATUS "asciidoc: ${ASCIIDOC_EXECUTABLE}") # ---------- PATHS diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index b8c5bc5baf5..0a5e627c2c3 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -8,6 +8,12 @@ if(ENABLE_DOCS) set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + # configure for graphviz + set(DOXYGEN_DIAGRAM "NO") + if(DOXYGEN_DOT_FOUND) + set(DOXYGEN_DIAGRAM "YES") + endif() + # request to configure the file configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index f48a3e763e6..7a2e8860182 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -1220,7 +1220,7 @@ HIDE_UNDOC_RELATIONS = YES # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = NO +HAVE_DOT = @DOXYGEN_DIAGRAM@ # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This From 17e0a2afa1bf12f693c7f8a16bac989066a9124f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20F=2E=20Aasen?= Date: Tue, 12 Jul 2022 08:18:04 +0200 Subject: [PATCH 2/2] docs: Create Doxygen graphs as svg Some advantages over png is file size and scalability. As far as I know, it's only IE 9+ that has compatibility issues with svg files. --- docs/Doxyfile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index 7a2e8860182..ea85b4a21c5 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -1316,7 +1316,7 @@ DIRECTORY_GRAPH = YES # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. -DOT_IMAGE_FORMAT = png +DOT_IMAGE_FORMAT = svg # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path.