From e9c7141d405487b0d1e694888fc8dff453994760 Mon Sep 17 00:00:00 2001 From: Juanjo Gutierrez Date: Sun, 23 Mar 2025 10:14:34 +0100 Subject: [PATCH] Make building docs optional --- .drone.yml | 2 +- CMakeLists.txt | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index f2a51bb..76e74e9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,7 +16,7 @@ steps: image: alpine commands: - apk add -t hermes-build-deps --no-cache perl graphviz doxygen gcc make openssl-dev libspf2-dev cmake g++ sqlite-dev gettext-dev - - cmake -B build_dir + - cmake -B build_dir -D BUILD_DOCS=ON - cmake --build build_dir - name: docker image build image: plugins/docker diff --git a/CMakeLists.txt b/CMakeLists.txt index c9d814d..257ad0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,8 @@ add_executable (hermes src/Proxy.cpp src/Socket.cpp) +option(BUILD_DOC "Build documentation") + if(WIN32) set(SOURCES ${SOURCES} src/FileLogger.cpp @@ -56,14 +58,16 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Configfile.cpp # doxygen -find_package (Doxygen REQUIRED dot) -if(DOXYGEN_FOUND) - add_custom_target(doc ALL - doxygen - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs) - install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/html - TYPE DOC) +if (BUILD_DOCS) + find_package (Doxygen) + if(DOXYGEN_FOUND) + add_custom_target(doc ALL + doxygen + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs) + install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/html + TYPE DOC) + endif() endif() target_link_libraries(hermes