From a6ea9bedc58582ef73415cc5d5d60c4ae50f3206 Mon Sep 17 00:00:00 2001 From: bmckwm Date: Tue, 1 Oct 2024 11:13:48 +0000 Subject: [PATCH 1/2] Option to build documentation formats separately Signed-off-by: bmckwm --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac8a188..dcafaa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,9 @@ cmake_policy(SET CMP0079 NEW) option(BUILD_STATIC "Builds library as static library" OFF) option(BUILD_TESTS "Builds tests" OFF) -option(BUILD_DOC "Builds documentation" OFF) +option(BUILD_DOC_MAN "Builds man page documentation" OFF) +option(BUILD_DOC_HTML "Builds html documentation" OFF) +option(BUILD_DOC_XML "Builds xml documentation" OFF) option(BUILD_DOXYGEN_AWESOME "Builds documentation alternative style" OFF) include(GNUInstallDirs) @@ -68,7 +70,7 @@ if (UNIX) endif() add_subdirectory(src) -if (BUILD_DOC) +if (BUILD_DOC_MAN OR BUILD_DOC_HTML OR BUILD_DOC_XML) find_package(Doxygen) if (DOXYGEN_FOUND) add_subdirectory(doc) From 8ad684144fddd469ec17a17be825b3edd4c5af6d Mon Sep 17 00:00:00 2001 From: bmckwm Date: Tue, 1 Oct 2024 11:20:37 +0000 Subject: [PATCH 2/2] Only install documentation if built --- doc/CMakeLists.txt | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 48e365d..0757340 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,6 +1,12 @@ -set(DOXYGEN_GENERATE_HTML YES) -set(DOXYGEN_GENERATE_MAN YES) -set(DOXYGEN_GENERATE_XML YES) +if (BUILD_DOC_HTML) + set(DOXYGEN_GENERATE_HTML YES) +endif() +if (BUILD_DOC_MAN) + set(DOXYGEN_GENERATE_MAN YES) +endif() +if (BUILD_DOC_XML) + set(DOXYGEN_GENERATE_XML YES) +endif() if (BUILD_DOXYGEN_AWESOME) include(ExternalProject) @@ -36,13 +42,25 @@ doxygen_add_docs( ALL COMMENT "Generate man and html pages" ) -install(DIRECTORY +if (BUILD_DOC_MAN) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man + TYPE DOC +) +endif() +if (BUILD_DOC_HTML) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html + TYPE DOC +) +endif() +if (BUILD_DOC_XML) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/xml TYPE DOC ) +endif() if (BUILD_DOXYGEN_AWESOME) add_dependencies(documentation doxygen-awesome-css) -endif() +endif() \ No newline at end of file