FindwxWidgets.cmake: Improve regex for version number matches

This commit is contained in:
Simon Richter 2016-02-15 18:50:48 +01:00
parent 2f1bbdc0f3
commit 029a3ba61e
1 changed files with 3 additions and 3 deletions

View File

@ -868,11 +868,11 @@ if(wxWidgets_FOUND AND wxWidgets_FIND_VERSION)
file(READ ${_filename} _wx_version_h)
string(REGEX REPLACE "^(.*\n)?#define wxMAJOR_VERSION[ ]+([0-9]+).*"
string(REGEX REPLACE "^(.*\n)?#define +wxMAJOR_VERSION +([0-9]+).*"
"\\2" wxWidgets_VERSION_MAJOR "${_wx_version_h}" )
string(REGEX REPLACE "^(.*\n)?#define wxMINOR_VERSION[ ]+([0-9]+).*"
string(REGEX REPLACE "^(.*\n)?#define +wxMINOR_VERSION +([0-9]+).*"
"\\2" wxWidgets_VERSION_MINOR "${_wx_version_h}" )
string(REGEX REPLACE "^(.*\n)?#define wxRELEASE_NUMBER[ ]+([0-9]+).*"
string(REGEX REPLACE "^(.*\n)?#define +wxRELEASE_NUMBER +([0-9]+).*"
"\\2" wxWidgets_VERSION_PATCH "${_wx_version_h}" )
set(wxWidgets_VERSION_STRING
"${wxWidgets_VERSION_MAJOR}.${wxWidgets_VERSION_MINOR}.${wxWidgets_VERSION_PATCH}" )