From 87282d2583eeb829c0bcacd4566bb0edd22a5e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= Date: Thu, 8 Jun 2023 11:25:58 +0200 Subject: [PATCH 1/2] [cmake] Fix Doxygen call ALL in doxygen_add_docs requries CMake 3.12 or newer. ALL in doxygen_add_docs comes after files or dirs --- CMakeLists.txt | 2 +- DOC/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88aecd6a..1bec77d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # Required version -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.12) # Project Version project(SuperLU C) diff --git a/DOC/CMakeLists.txt b/DOC/CMakeLists.txt index 8b9e9feb..63f0b63f 100644 --- a/DOC/CMakeLists.txt +++ b/DOC/CMakeLists.txt @@ -15,10 +15,10 @@ if(enable_doc) endif() doxygen_add_docs(doc - "${_DEPENDENCY_ALL}" "${CMAKE_CURRENT_SOURCE_DIR}/mainpage.txt" "${CMAKE_CURRENT_SOURCE_DIR}/modules.txt" "${PROJECT_SOURCE_DIR}/EXAMPLE" "${PROJECT_SOURCE_DIR}/SRC" "${PROJECT_SOURCE_DIR}/TESTING" + "${_DEPENDENCY_ALL}" COMMENT "Generate HTML documentation with Doxygen") From c36a1faf095b75c4ff2f74e3014a35976e48ba30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= Date: Thu, 8 Jun 2023 16:01:29 +0200 Subject: [PATCH 2/2] [cmake] Prevent creation of target doc if Doxygen was not found Calling doxygen_add_docs without Doxygen leads to an fatal error. --- DOC/CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/DOC/CMakeLists.txt b/DOC/CMakeLists.txt index 63f0b63f..70aa0136 100644 --- a/DOC/CMakeLists.txt +++ b/DOC/CMakeLists.txt @@ -14,11 +14,15 @@ if(enable_doc) set(_DEPENDENCY_ALL "ALL") endif() -doxygen_add_docs(doc - "${CMAKE_CURRENT_SOURCE_DIR}/mainpage.txt" - "${CMAKE_CURRENT_SOURCE_DIR}/modules.txt" - "${PROJECT_SOURCE_DIR}/EXAMPLE" - "${PROJECT_SOURCE_DIR}/SRC" - "${PROJECT_SOURCE_DIR}/TESTING" - "${_DEPENDENCY_ALL}" - COMMENT "Generate HTML documentation with Doxygen") +if(DOXYGEN_FOUND) + doxygen_add_docs(doc + "${CMAKE_CURRENT_SOURCE_DIR}/mainpage.txt" + "${CMAKE_CURRENT_SOURCE_DIR}/modules.txt" + "${PROJECT_SOURCE_DIR}/EXAMPLE" + "${PROJECT_SOURCE_DIR}/SRC" + "${PROJECT_SOURCE_DIR}/TESTING" + "${_DEPENDENCY_ALL}" + COMMENT "Generate HTML documentation with Doxygen") +elseif(enable_doc) + message(WARNING "Disabling building documentation as Doxygen is missing.") +endif()