From 2c297ea15deb268688c20ff42fa5a34b6ebbc012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Sun, 29 Sep 2024 12:48:15 +0200 Subject: [PATCH] Control optional doxygen dependency --- CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 784ed4e..597740e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,10 +93,14 @@ install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/bayesnet/config.h DES # Documentation # ------------- find_package(Doxygen) -set(DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs) -set(doxyfile_in ${DOC_DIR}/Doxyfile.in) -set(doxyfile ${DOC_DIR}/Doxyfile) -configure_file(${doxyfile_in} ${doxyfile} @ONLY) -doxygen_add_docs(doxygen - WORKING_DIRECTORY ${DOC_DIR} +if (Doxygen_FOUND) + set(DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/docs) + set(doxyfile_in ${DOC_DIR}/Doxyfile.in) + set(doxyfile ${DOC_DIR}/Doxyfile) + configure_file(${doxyfile_in} ${doxyfile} @ONLY) + doxygen_add_docs(doxygen + WORKING_DIRECTORY ${DOC_DIR} CONFIG_FILE ${doxyfile}) +else (Doxygen_FOUND) + MESSAGE("* Doxygen not found") +endif (Doxygen_FOUND)