FindLibXklavier.cmake's version checking

Alexander Neundorf neundorf at kde.org
Fri Oct 16 21:53:13 CEST 2009


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.

Alex


More information about the Kde-buildsystem mailing list