macro_ensure_version_range() problem

Alexander Neundorf neundorf at kde.org
Thu Aug 11 20:12:57 UTC 2011


On Saturday 06 August 2011, Allen Winter wrote:
> Howdy,
> 
> In kde-workspace/solid/CMakeLists.txt we have this:
> 
> macro_ensure_version_range("0.7.0" ${NETWORKMANAGER_VERSION} "0.8.10"
> NM_0_7)
> 
> which is failing for me because in Fedora15, NETWORKMANGER_VERSION=0.8.9997
> 
> So this is a request for someone to look at fixing
> macro_ensure_version_range() to properly handle a version number like
> 0.8.9997.
> 
> In fact, kdelibs/cmake/modules/MacroEnsureVersion.cmake has the comment:
> "This macro will break silently if any of x,y,z are greater than 100."
> 
> Maybe truncating each x,y,z to the first 2 digits would be enough?

Is it the regular expression which fails or the comparison of the numbers ?
It looks like the comparison is the problem:
MATH(EXPR ${_normalized_version} "${_major_vers}*10000 + ${_minor_vers}*100 + 
${_patch_vers}")

Can you try whether it works if you use if( VERSION_LESS/EQUAL/GREATER ) there 
? (this didn't exist back then).

If you change something there, can you please also change it in extra-cmake-
modules/attic/ ?

I'm not sure whether we should start to depend on extra-cmake-modules also for 
kdelibs4, or only for kf5 :-)
Or is it kf1 ? I mean, it is the first one.

Alex


More information about the Kde-buildsystem mailing list