From 0c3c5302dcf82c866d2febdab574d8b185393f9c Mon Sep 17 00:00:00 2001 From: David Wells Date: Thu, 18 Jun 2020 17:28:48 -0400 Subject: [PATCH] Fix detection of muParser 2.3.2. --- cmake/modules/FindMUPARSER.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmake/modules/FindMUPARSER.cmake b/cmake/modules/FindMUPARSER.cmake index 7f4066adb0..771d6ff5e8 100644 --- a/cmake/modules/FindMUPARSER.cmake +++ b/cmake/modules/FindMUPARSER.cmake @@ -42,9 +42,22 @@ DEAL_II_FIND_PATH(MUPARSER_INCLUDE_DIR muParserDef.h IF(EXISTS ${MUPARSER_INCLUDE_DIR}/muParserDef.h) FILE(STRINGS "${MUPARSER_INCLUDE_DIR}/muParserDef.h" MUPARSER_VERSION_STRING_LINE + # Try to match the line + # + # #define MUP_VERSION _T("2.2.4") REGEX "#define MUP_VERSION _T" ) - + + IF("${MUPARSER_VERSION_STRING_LINE}" STREQUAL "") + # try again with the newer version format (starting in at least 2.3.2), + # which matches the line + # + # static const string_type ParserVersion = string_type(_T("2.3.2")); + FILE(STRINGS "${MUPARSER_INCLUDE_DIR}/muParserDef.h" MUPARSER_VERSION_STRING_LINE + REGEX "string_type ParserVersion = string_type" + ) + ENDIF() + STRING(REGEX REPLACE ".*\"(.*)\".*" "\\1" _VERSION_STRING "${MUPARSER_VERSION_STRING_LINE}" ) -- 2.39.5