From a7e7fdce34d2d1211369663f3d6d61e2915ad6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jules=20P=C3=A9nuchot?= Date: Mon, 8 Dec 2025 11:23:43 +0100 Subject: [PATCH] Added Doxygen with Doxygen Awesome CSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jules Pénuchot See merge request oss/rotgen!49 --- CMakeLists.txt | 5 +++++ cmake/docs.cmake | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 cmake/docs.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a8a307b..a608bfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,3 +96,8 @@ include(${ROTGEN_SOURCE_DIR}/cmake/config/rotgen-install.cmake) ## Setup the library's Tests ##============================================================================== add_subdirectory(test) + +##============================================================================== +## Setup the library's documentation +##============================================================================== +include(${ROTGEN_SOURCE_DIR}/cmake/docs.cmake) diff --git a/cmake/docs.cmake b/cmake/docs.cmake new file mode 100644 index 0000000..65ae50b --- /dev/null +++ b/cmake/docs.cmake @@ -0,0 +1,41 @@ +##============================================================================== +## ROTGEN - Runtime Overlay for Eigen +## Copyright : CODE RECKONS +## SPDX-License-Identifier: BSL-1.0 +##============================================================================== + +find_package(Doxygen COMPONENTS dot OPTIONAL_COMPONENTS mscgen dia) + +if(Doxygen_FOUND) + + # Documentation options + set(DOXYGEN_EXTRACT_ALL YES) + set(DOXYGEN_GENERATE_TREEVIEW YES) + set(DOXYGEN_EXCLUDE_PATTERNS */build/* */test/*) + set(DOXYGEN_USE_MDFILE_AS_MAINPAGE ${CMAKE_SOURCE_DIR}/README.md) + set(DOXYGEN_EXAMPLE_PATH ${CMAKE_SOURCE_DIR}) + set(DOXYGEN_DOT_TRANSPARENT YES) + set(DOXYGEN_IMAGE_PATH ${CMAKE_SOURCE_DIR}) + + # ============================================================================ + # Doxygen Awesome CSS + + include(FetchContent) + + FetchContent_Declare( + doxygen_awesome_content + GIT_REPOSITORY https://github.com/jothepro/doxygen-awesome-css.git + GIT_TAG v2.4.1 + GIT_SHALLOW) + + FetchContent_GetProperties(doxygen_awesome_content) + if(NOT doxygen_awesome_content_POPULATED) + FetchContent_Populate(doxygen_awesome_content) + endif() + + set(DOXYGEN_HTML_EXTRA_STYLESHEET + ${doxygen_awesome_content_SOURCE_DIR}/doxygen-awesome.css) + + doxygen_add_docs(docs) + +endif()