On Fri, Oct 16, 2009 at 4:53 PM, Alexander Neundorf <[email protected]> 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? _______________________________________________ Kde-buildsystem mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-buildsystem
