From: Fabian Castelli Date: Sat, 3 Jul 2021 12:54:25 +0000 (+0200) Subject: Update sundials version number extraction X-Git-Tag: v9.4.0-rc1~1161^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12545%2Fhead;p=dealii.git Update sundials version number extraction --- 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