diff options
author | Laurent Montel <montel@kde.org> | 2006-09-28 12:33:33 +0000 |
---|---|---|
committer | Laurent Montel <montel@kde.org> | 2006-09-28 12:33:33 +0000 |
commit | 8bd7e5ecf5b27cfcf56e697230f772988955d0d9 (patch) | |
tree | fa96d015d801abe89b14fd61916bbe8ad225af21 | |
parent | b6914db0ecaf0555d6ba25e8f10b21e9cd31c80a (diff) | |
download | extra-cmake-modules-8bd7e5ecf5b27cfcf56e697230f772988955d0d9.tar.gz extra-cmake-modules-8bd7e5ecf5b27cfcf56e697230f772988955d0d9.tar.bz2 |
Necessary to test patch version
Otherwise 2.5.4 is inferior to 2.5.31
In this function we calculate it as :
2.5.4: 2*1000+5*100+4 = 2504
2.5.31: 2*1000+5*100+31 = 2531
=> it was supperior.
Now I test last patch version and adapt it.
svn path=/trunk/KDE/kdelibs/; revision=589662
-rw-r--r-- | modules/MacroEnsureVersion.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/MacroEnsureVersion.cmake b/modules/MacroEnsureVersion.cmake index badb50db..fee62c7f 100644 --- a/modules/MacroEnsureVersion.cmake +++ b/modules/MacroEnsureVersion.cmake @@ -22,6 +22,11 @@ MACRO(MACRO_ENSURE_VERSION requested_version found_version var_too_old) 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}") + # Necessary to multiply by 10 otherwise 2.5.4 is inferior to 2.5.31 + if( req_patch_vers GREATER "9" AND found_patch_vers LESS "10") + MATH(EXPR found_patch_vers "${found_patch_vers}*10") + endif(req_patch_vers GREATER "9" AND found_patch_vers LESS "10") + # 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}") MATH(EXPR found_vers_num "${found_major_vers}*10000 + ${found_minor_vers}*100 + ${found_patch_vers}") |