Commit 6d38dd25 authored by Guillaume Pasero's avatar Guillaume Pasero

ENH: fix muParser version parsing

parent 37f24f2d
......@@ -22,6 +22,12 @@ find_path( MUPARSER_INCLUDE_DIR muParser.h
if(EXISTS "${MUPARSER_INCLUDE_DIR}/muParserDef.h")
file(READ "${MUPARSER_INCLUDE_DIR}/muParserDef.h" _muParserDef_h_CONTENTS)
string(REGEX REPLACE ".*# *define MUP_VERSION *_T\\(\"([0-9.]+)\"\\).*" "\\1" MUPARSER_VERSION "${_muParserDef_h_CONTENTS}")
if(MUPARSER_VERSION MATCHES "^[0-9]+\$")
set(MUPARSER_VERSION "${MUPARSER_VERSION}.0.0")
endif()
if(MUPARSER_VERSION MATCHES "^[0-9]+\\.[0-9]+\$")
set(MUPARSER_VERSION "${MUPARSER_VERSION}.0")
endif()
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" MUPARSER_VERSION_MAJOR "${MUPARSER_VERSION}")
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" MUPARSER_VERSION_MINOR "${MUPARSER_VERSION}")
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" MUPARSER_VERSION_PATCH "${MUPARSER_VERSION}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment