From 1abea55a346e5799e726091b57e84ec142b8b740 Mon Sep 17 00:00:00 2001 From: Fabian Castelli Date: Sat, 3 Jul 2021 14:54:25 +0200 Subject: [PATCH] Update sundials version number extraction --- cmake/configure/configure_sundials.cmake | 33 ++++++++++++------------ cmake/modules/FindSUNDIALS.cmake | 14 +++------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/cmake/configure/configure_sundials.cmake b/cmake/configure/configure_sundials.cmake index 1f772f18c0..b8042db44f 100644 --- a/cmake/configure/configure_sundials.cmake +++ b/cmake/configure/configure_sundials.cmake @@ -22,23 +22,24 @@ MACRO(FEATURE_SUNDIALS_FIND_EXTERNAL var) IF(SUNDIALS_FOUND) SET(${var} TRUE) - ENDIF() - - # - # We require at least sundials 3.0.0 - # - IF(SUNDIALS_VERSION VERSION_LESS 3.0.0) - MESSAGE(STATUS "Could not find a sufficient Sundials installation: " - "deal.II requires at least version 3.0.0, but version ${SUNDIALS_VERSION} was found." - ) - SET(SUNDIALS_ADDITIONAL_ERROR_STRING - ${SUNDIALS_ADDITIONAL_ERROR_STRING} - "The SUNDIALS installation (found at \"${SUNDIALS_DIR}\")\n" - "with version ${SUNDIALS_VERSION} is too old.\n" - "deal.II requires at least version 3.0.0.\n\n" - ) - SET(${var} FALSE) + # + # We require at least sundials 3.0.0 + # + SET(_version_required 3.0.0) + IF(SUNDIALS_VERSION VERSION_LESS ${_version_required}) + MESSAGE(STATUS "Could not find a sufficient Sundials installation: " + "deal.II requires at least version ${_version_required}, " + "but version ${SUNDIALS_VERSION} was found." + ) + SET(SUNDIALS_ADDITIONAL_ERROR_STRING + ${SUNDIALS_ADDITIONAL_ERROR_STRING} + "The SUNDIALS installation (found at \"${SUNDIALS_DIR}\")\n" + "with version ${SUNDIALS_VERSION} is too old.\n" + "deal.II requires at least version ${_version_required}.\n\n" + ) + SET(${var} FALSE) + ENDIF() ENDIF() ENDMACRO() diff --git a/cmake/modules/FindSUNDIALS.cmake b/cmake/modules/FindSUNDIALS.cmake index abb86246bf..dbfb90377c 100644 --- a/cmake/modules/FindSUNDIALS.cmake +++ b/cmake/modules/FindSUNDIALS.cmake @@ -116,19 +116,11 @@ IF(NOT SUNDIALS_CONFIG_H MATCHES "-NOTFOUND") STRING(REGEX REPLACE "^.*SUNDIALS_VERSION_PATCH.*([0-9]+).*" "\\1" SUNDIALS_VERSION_PATCH "${SUNDIALS_VERSION_PATCH_STRING}" ) -ENDIF() -IF(NOT "${SUNDIALS_VERSION_MAJOR}") - SET(SUNDIALS_VERSION_MAJOR "0") -ENDIF() -IF(NOT "${SUNDIALS_VERSION_MINOR}") - SET(SUNDIALS_VERSION_MINOR "0") -ENDIF() -IF(NOT "${SUNDIALS_VERSION_PATCH}") - SET(SUNDIALS_VERSION_PATCH "0") -ENDIF() -SET(SUNDIALS_VERSION + + SET(SUNDIALS_VERSION "${SUNDIALS_VERSION_MAJOR}.${SUNDIALS_VERSION_MINOR}.${SUNDIALS_VERSION_PATCH}" ) +ENDIF() DEAL_II_PACKAGE_HANDLE(SUNDIALS LIBRARIES REQUIRED -- 2.39.5