From: Matthias Maier Date: Mon, 1 Oct 2018 18:18:35 +0000 (-0500) Subject: CMake: FindSLEPC.cmake: Fix regex for version number X-Git-Tag: v9.0.1~7^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7261%2Fhead;p=dealii.git CMake: FindSLEPC.cmake: Fix regex for version number Similarly to what was fixed in #7203, fix the regex to also pick up two (or more digit) version numbers correctly. --- diff --git a/cmake/modules/FindSLEPC.cmake b/cmake/modules/FindSLEPC.cmake index 2de9a29aa0..761875b26e 100644 --- a/cmake/modules/FindSLEPC.cmake +++ b/cmake/modules/FindSLEPC.cmake @@ -66,22 +66,22 @@ SET(SLEPC_SLEPCVERSION_H "${SLEPC_INCLUDE_DIR_COMMON}/slepcversion.h") IF(EXISTS ${SLEPC_SLEPCVERSION_H}) FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_MAJOR_STRING REGEX "#define.*SLEPC_VERSION_MAJOR") - STRING(REGEX REPLACE "^.*SLEPC_VERSION_MAJOR.*([0-9]+).*" "\\1" + STRING(REGEX REPLACE "^.*SLEPC_VERSION_MAJOR.* ([0-9]+).*" "\\1" SLEPC_VERSION_MAJOR "${SLEPC_VERSION_MAJOR_STRING}" ) FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_MINOR_STRING REGEX "#define.*SLEPC_VERSION_MINOR") - STRING(REGEX REPLACE "^.*SLEPC_VERSION_MINOR.*([0-9]+).*" "\\1" + STRING(REGEX REPLACE "^.*SLEPC_VERSION_MINOR.* ([0-9]+).*" "\\1" SLEPC_VERSION_MINOR "${SLEPC_VERSION_MINOR_STRING}" ) FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_SUBMINOR_STRING REGEX "#define.*SLEPC_VERSION_SUBMINOR") - STRING(REGEX REPLACE "^.*SLEPC_VERSION_SUBMINOR.*([0-9]+).*" "\\1" + STRING(REGEX REPLACE "^.*SLEPC_VERSION_SUBMINOR.* ([0-9]+).*" "\\1" SLEPC_VERSION_SUBMINOR "${SLEPC_VERSION_SUBMINOR_STRING}" ) FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_PATCH_STRING REGEX "#define.*SLEPC_VERSION_PATCH") - STRING(REGEX REPLACE "^.*SLEPC_VERSION_PATCH.*([0-9]+).*" "\\1" + STRING(REGEX REPLACE "^.*SLEPC_VERSION_PATCH.* ([0-9]+).*" "\\1" SLEPC_VERSION_PATCH "${SLEPC_VERSION_PATCH_STRING}" ) SET(SLEPC_VERSION