Skip to content

Commit 63906c0

Browse files
committed
CMakelist: rework the documentation-related to avoid automagic
1 parent cb1c1f9 commit 63906c0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,24 +390,23 @@ set(CPACK_SOURCE_STRIP_FILES "")
390390
include(CPack)
391391

392392
#doxygen
393-
find_package(Doxygen)
394-
option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
395-
396-
if(NOT DOXYGEN_FOUND)
397-
message("Doxygen is needed to build the documentation.")
398-
endif()
399-
400-
if(DOXYGEN_FOUND)
393+
option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ON)
394+
if (BUILD_DOCUMENTATION)
395+
find_package(Doxygen)
396+
if(DOXYGEN_FOUND)
401397
set(docdirectory ${CMAKE_CURRENT_SOURCE_DIR}/doc)
402398
file(MAKE_DIRECTORY ${docdirectory})
403399
set(doxyfile ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)
404400
configure_file(${doxyfile} @ONLY)
405-
message("Doxygen build started.")
406401
add_custom_target(doc
407402
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
408403
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
409404
COMMENT "Generating API documentation with Doxygen"
410405
VERBATIM)
406+
else()
407+
message("Doxygen is needed to build the documentation.")
408+
set(BUILD_DOCUMENTATION OFF)
409+
endif()
411410
endif()
412411

413412
#Messages
@@ -425,4 +424,5 @@ message(" Release/Other: you must install the application before you can run it"
425424
message("* Update translations: UPDATE_TRANSLATIONS=${UPDATE_TRANSLATIONS}")
426425
message(" WARNING: Do not run \"make clean\" when in update translation mode!")
427426
message(" Run \"make translations_target\" to re-generate translations")
427+
message("* Build documentation: BUILD_DOCUMENTATION=${BUILD_DOCUMENTATION}")
428428
message("")

0 commit comments

Comments
 (0)