aboutsummaryrefslogtreecommitdiff
path: root/modules/MacroEnsureVersion.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2006-07-03 23:45:27 +0000
committerAlexander Neundorf <neundorf@kde.org>2006-07-03 23:45:27 +0000
commita98eacc458a303f769590c6af4bfae6920845a51 (patch)
tree674c7d82ae8065b70543104b07c066fe2175149a /modules/MacroEnsureVersion.cmake
parent0779a7d525ef03ef4f1102cb5245b87c0206a36e (diff)
downloadextra-cmake-modules-a98eacc458a303f769590c6af4bfae6920845a51.tar.gz
extra-cmake-modules-a98eacc458a303f769590c6af4bfae6920845a51.tar.bz2
-use positive logic for macro_ensure_version(MIN found RESULT) -> result is true, if the vesion is ok
-first try at creating batch files under windows -prepare a libexec install dir -better check for visibility support: only for gcc >= 4.1 if not compiled with the mt allocator Alex svn path=/trunk/KDE/kdelibs/; revision=557782
Diffstat (limited to 'modules/MacroEnsureVersion.cmake')
-rw-r--r--modules/MacroEnsureVersion.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/MacroEnsureVersion.cmake b/modules/MacroEnsureVersion.cmake
index 89047307..091152d4 100644
--- a/modules/MacroEnsureVersion.cmake
+++ b/modules/MacroEnsureVersion.cmake
@@ -1,12 +1,12 @@
# LGPL-v2, David Faure
#
# This macro compares version numbers of the form "x.y.z"
-# MACRO_ENSURE_VERSION( ${FOO_MIN_VERSION} ${FOO_VERSION_FOUND} FOO_TOO_OLD)
-# will set FOO_TOO_OLD to true if FOO_VERSION_FOUND < FOO_MIN_VERSION
+# MACRO_ENSURE_VERSION( ${FOO_MIN_VERSION} ${FOO_VERSION_FOUND} FOO_VERSION_OK)
+# will set FOO_VERSIN_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION
#
MACRO(MACRO_ENSURE_VERSION requested_version found_version var_too_old)
- # parse the parts of the version strings
+ # parse the parts of the version string
STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_major_vers "${requested_version}")
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}")
@@ -20,6 +20,8 @@ MACRO(MACRO_ENSURE_VERSION requested_version found_version var_too_old)
MATH(EXPR found_vers_num "${found_major_vers}*10000 + ${found_minor_vers}*100 + ${found_patch_vers}")
if (found_vers_num LESS req_vers_num)
+ set( ${var_too_old} FALSE )
+ else (found_vers_num LESS req_vers_num)
set( ${var_too_old} TRUE )
endif (found_vers_num LESS req_vers_num)