From 8bd7e5ecf5b27cfcf56e697230f772988955d0d9 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Thu, 28 Sep 2006 12:33:33 +0000 Subject: 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 --- modules/MacroEnsureVersion.cmake | 5 +++++ 1 file changed, 5 insertions(+) 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}") -- cgit v1.2.1