Support CMake-Version-Variables

Alexander Neundorf neundorf at kde.org
Fri Aug 15 21:56:42 CEST 2008


On Friday 15 August 2008, Andreas Pakulat wrote:
> On 15.08.08 00:13:49, Alexander Neundorf wrote:
> > On Thursday 07 August 2008, Andreas Pakulat wrote:
> > > On 07.08.08 22:11:11, Thiago Macieira wrote:
> > > > Andreas Pakulat wrote:
> > > > >This has a problem, I can't depend on KDE 4.2.0 until its released
> > > > > and hence modules in trunk/ cannot have a dependency on kdelibs
> > > > > from trunk/
> > > > >
> > > > >For example kdevplatform now has a hard dependency on kdelibs from
> > > > >trunk/, so what I need is require KDE >= 4.1.60 (current version
> > > > > used in trunk/) not 4.2.0 as that doesn't exist yet and 4.1.0
> > > > > doesn't work anymore.
> > > >
> > > > Right, sorry. I hadn't thought of pre-releases.
> > >
> > > Thanks for doing the logic-thinking for me :) Patch attached, it uses a
> > > negation of your pseudo-code to avoid having to create new variables.
> > >
> > > Andreas
> >
> > Looks good from the technical side.
> > Still there is one thing:
> > right now the way to specify the required KDE version is to set the
> > KDE_MIN_VERSION variable before calling find_package(KDE4).
> >
> > This patch now adds a second way how to specify the required version.
> > Pro:
> > -this is how find_package() now supports specifying the minimum version
> > number, i.e. in some way the officially recommended way
>
> Another pro is that we don't have to take care of moving a whole block
> (variable-setting+find_package) when reorganizing a module's
> CMakeLists.txt.
>
> > Con:
> > -with the patch there are now two ways how to do the same thing (and the
> > old way has to stay, in order to stay source compatible)
>
> Well, while I agree its better to leave it in, the variable isn't
> documented and hence is IMHO an internal variable - 

Ooops, this is a bug, this variable was/is intended to be public.

> > -several other modules also support FOO_MIN_VERSION or similar variables,
> > so using such a variable is currently kind of de-facto standard for
> > specifying the minimum version.
>
> Well, I think those modules support a version variable only because
> there was no other way until now. If we'd always just stay with what we
> have we'd never make any progress at all :)

So feel free to commit.

Alex


More information about the Kde-buildsystem mailing list