aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2007-01-15 10:55:23 +0000
committerDavid Faure <faure@kde.org>2007-01-15 10:55:23 +0000
commit6b8bf982f6253e457e4a60060bb0acd279164e1b (patch)
tree60fe9c7fe383b027c21faedf413979ea0e41512b
parent0a20a5f0e83606c4ebe5e1685871b5b61fb160df (diff)
downloadextra-cmake-modules-6b8bf982f6253e457e4a60060bb0acd279164e1b.tar.gz
extra-cmake-modules-6b8bf982f6253e457e4a60060bb0acd279164e1b.tar.bz2
Fix parsing of found_version when it starts with letters, like "Flex 2.5.4a".
Otherwise it would set found_major_vers = "Flex 2" etc. Report, analysis, and fix by Marc.Schodermayr telemotive.de - thanks! svn path=/trunk/KDE/kdelibs/; revision=623718
-rw-r--r--modules/MacroEnsureVersion.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/MacroEnsureVersion.cmake b/modules/MacroEnsureVersion.cmake
index badb50db..9d936ce7 100644
--- a/modules/MacroEnsureVersion.cmake
+++ b/modules/MacroEnsureVersion.cmake
@@ -18,9 +18,9 @@ MACRO(MACRO_ENSURE_VERSION requested_version found_version var_too_old)
STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" req_minor_vers "${requested_version}")
STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_patch_vers "${requested_version}")
- STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_major_vers "${found_version}")
- STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" found_minor_vers "${found_version}")
- STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_patch_vers "${found_version}")
+ STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_major_vers "${found_version}")
+ STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" found_minor_vers "${found_version}")
+ STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_patch_vers "${found_version}")
# compute an overall version number which can be compared at once
MATH(EXPR req_vers_num "${req_major_vers}*10000 + ${req_minor_vers}*100 + ${req_patch_vers}")