]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix detection of muParser 2.3.2. 10550/head
authorDavid Wells <drwells@email.unc.edu>
Thu, 18 Jun 2020 21:28:48 +0000 (17:28 -0400)
committerDavid Wells <drwells@email.unc.edu>
Mon, 22 Jun 2020 12:57:30 +0000 (08:57 -0400)
cmake/modules/FindMUPARSER.cmake

index 7f4066adb049efdc3ee93b653b7dceea4b935743..771d6ff5e89b7366e01cd7b43cedf28f8a7ae968 100644 (file)
@@ -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}"
     )

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.