Make building docs optional
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Juan José Gutiérrez de Quevedo Pérez 2025-03-23 10:14:34 +01:00
parent 6b610aaa84
commit e9c7141d40
2 changed files with 13 additions and 9 deletions

View file

@ -16,7 +16,7 @@ steps:
image: alpine image: alpine
commands: commands:
- apk add -t hermes-build-deps --no-cache perl graphviz doxygen gcc make openssl-dev libspf2-dev cmake g++ sqlite-dev gettext-dev - 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 - cmake --build build_dir
- name: docker image build - name: docker image build
image: plugins/docker image: plugins/docker

View file

@ -14,6 +14,8 @@ add_executable (hermes
src/Proxy.cpp src/Proxy.cpp
src/Socket.cpp) src/Socket.cpp)
option(BUILD_DOC "Build documentation")
if(WIN32) if(WIN32)
set(SOURCES ${SOURCES} set(SOURCES ${SOURCES}
src/FileLogger.cpp src/FileLogger.cpp
@ -56,14 +58,16 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Configfile.cpp
# doxygen # doxygen
find_package (Doxygen REQUIRED dot) if (BUILD_DOCS)
if(DOXYGEN_FOUND) find_package (Doxygen)
add_custom_target(doc ALL if(DOXYGEN_FOUND)
doxygen add_custom_target(doc ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs) doxygen
install( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs)
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/html install(
TYPE DOC) DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/html
TYPE DOC)
endif()
endif() endif()
target_link_libraries(hermes target_link_libraries(hermes