From 481c24087a23ad551e3ccccd260fa4896c963c2c Mon Sep 17 00:00:00 2001 From: Abdessattar Sassi <457645+abdes@users.noreply.github.com> Date: Fri, 21 Apr 2023 21:06:20 +0400 Subject: [PATCH] feat: add build option to enable or disable docs targets New option: ASAP_BUILD_DOCS. When ON, doxygen and sphinx targets will be added and the detection of the required tools is done. --- CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 709162a..e54a456 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,7 @@ asap_push_project(${META_PROJECT_NAME}) # cmake-format: off option(BUILD_SHARED_LIBS "Build shared instead of static libraries." ON) option(ASAP_BUILD_TESTS "Setup target to build and run tests." OFF) +option(ASAP_BUILD_EXAMPLES "Setup target to build the examples." OFF) option(ASAP_BUILD_DOCS "Setup target to build the doxygen and sphinx docs." ON) option(ASAP_WITH_GOOGLE_ASAN "Instrument code with address sanitizer" OFF) option(ASAP_WITH_GOOGLE_UBSAN "Instrument code with undefined behavior sanitizer" OFF) @@ -146,13 +147,15 @@ configure_file(.clangd.in ${CMAKE_SOURCE_DIR}/.clangd @ONLY) # Documentation - doxygen, sphinx/breathe/exhale # ------------------------------------------------------------------------------ -# Doxygen -set(DOXYGEN_BUILD_DIR "${CMAKE_BINARY_DIR}/dox") -include(DoxGeneration) +if (ASAP_BUILD_DOCS) + # Doxygen + set(DOXYGEN_BUILD_DIR "${CMAKE_BINARY_DIR}/dox") + include(DoxGeneration) -# Sphinx/breathe/exhale -set(SPHINX_BUILD_DIR "${CMAKE_BINARY_DIR}/sphinx") -include(SphinxGeneration) + # Sphinx/breathe/exhale + set(SPHINX_BUILD_DIR "${CMAKE_BINARY_DIR}/sphinx") + include(SphinxGeneration) +endif() # ------------------------------------------------------------------------------ # Testing