FindLibXklavier.cmake's version checking

Alexander Neundorf neundorf at kde.org
Mon Oct 19 19:09:53 CEST 2009


On Sunday 18 October 2009, Raphael Kubo da Costa wrote:
> On Fri, Oct 16, 2009 at 4:53 PM, Alexander Neundorf <neundorf at kde.org> 
wrote:
> > On Friday 16 October 2009, Raphael Kubo da Costa wrote:
> >> Hi there,
> >>
> >> Since version 4.0, libxklavier has changed the signature of one of its
> >> functions. Commit 992187 attempts to fix kdebase, however it doesn't
> >> work: libxklavier only returns its version via pkg-config, so
> >> LIBXKLAVIER_VERSION is set to values such as 4.0, which fail with the
> >> current solution (#ifdef LIBXKLAVIER_VERSION > 40).
> >>
> >> I presume there isn't a easy, clean way to fix that, right? What
> >> should be done? Set another variable in FindLibXklavier.cmake, such as
> >> LIBXKLAVIER_VERSION_AT_LEAST_4?
> >
> > Oops, seems I never before had a look at FindLibXKlavier.cmake.
> > That one is completely broken and needs to be rewritten.
> > The stuff from pkg-config must only be used as hints for the actual
> > find_xxx() calls.
> > Support for specifying required versions acn be added.
> > To detect the version, different things could be done.
> > Headers files could be checked, you could try to compile something which
> > uses the new function, and decide based on that result which version you
> > have, maybe more.
> >
> > IOW there is a clean way to fix, it is writing a proper
> > FindLibXKlavier.cmake. kdelibs/cmake/modules/FindLibXml2.cmake can be
> > used as an example. Once this is done, we can look into how to do the
> > version check.
>
> Apparently, most of the changes that made FindLibXklavier.cmake what
> it looks like today were done in revision 991943 - curiously enough,
> the commit message says it was to adapt things libxklavier's 4.0
> release :)
>
> I don't understand why some names were changed
> (LIBXKLAVIER_DEFINITIONS -> LIBXKLAVIER_CFLAGS, for example), and at
> least kdebase/workspace/kcontrol/kxkb/CMakeLists.txt seems to depend
> on the current names.
>
> Alex, what do you think of reverting names and some of the code to the
> way it was before that commit (which makes it look a lot like
> FindLibXml2.cmake actually) and setting LIBXKLAVIER_VERSION_MAJOR,
> LIBXKLAVIER_VERSION_MINOR and LIBXKLAVIER_VERSION_NUM as done by
> kxkb's CMakeLists.txt?

I'd even prefer to start that thing from scratch, by taking FindLibXMl2.cmake 
as example.
As it is now I consider it completely broken, there's not much in it worth to 
keep. No need to keep compatibility with the one shipped with kdebase 4.3 
(which broke compat to 4.2).

Would be nice if you could post a first version and I'll help you get it in 
shape.

Alex


More information about the Kde-buildsystem mailing list