cmake linking to old libraries. Bug or feature? (was: Re: KDE/kdebase/workspace/plasma/dataengines)

Thiago Macieira thiago at
Fri May 8 16:12:07 CEST 2009

Em Sexta-feira 08 Maio 2009, às 14:41:01, Thiago Macieira escreveu:
> Em Quinta-feira 07 Maio 2009, às 17:50:55, Sebastian Kügler escreveu:
> > SVN commit 964889 by sebas:
> >
> > Add Akonadi libs
> >
> > This should resolve the linking problems thiago got. Thiago, can you
> > confirm?
> No, sorry, still not working.
> You're linking to ${KDE4_AKONADI_LIBS} but that variable is not defined
> anywhere. I've just updated and rebuilt Akonadi and I don't see that
> anywhere.
> A full grep of kdesupport, kdelibs, kdepimlibs and kdebase yields only two
> results for that string and they're both acceors (not settings it).

Actually, I found where that variable is defined. It took some help from the 
folks in #kontact to find it: it's defined in the KdepimLibsConfig.cmake, by way 
of a macro. That's why my grep didn't turn it up.

So it appears that the variable is properly defined after all:
message("Here's akonadi: " ${KDE4_AKONADI_LIBS})
Here's akonadi: KDEPIMLibs__akonadi-kde

That's the correct value, according to the developers (that surprised me).

So the problem had to be somewhere else. After searching a bit, I found that 
the link line to the dataengine was:

g++ [...] -o ../../../../lib/ [...] 

So it was linking to the older library found (I had newer versions). Since 
none of the find_package or macro_optional_find_package for kdepimlibs had the 
version number, can we say it's a feature to link to the lowest version found? 
I.e., is this intentional so that we catch requirements for later features?

I tried to write in 
	find_package(KdepimLibs 4.3 REQUIRED)

and that didn't work. I did have the "4.3.0" version installed from an earlier 
build, before it was removed. So another question: if a later dependency 
requires a newer version than a previous dependency, does cmake use the most 
constraining requirement? I would be surprised if it did, but it would be 

In any case, after changing 
kdebase/workspace/plasma/dataengines/CMakeLists.txt to say:
	macro_optional_find_package(KdepimLibs 4.2.85)
things started working. I have committed that fix.

Then I deleted the the lib/cmake/KdepimLibs-4.3.0/ directory from my KDE 4 
installation and things started working without any version number at all (the 
code before my commit). I can't explain why. But this is a surprise factor and 
could be a bug.

In time, I still have both lib/cmake/KdepimLibs-4.2.0 and 
lib/cmake/KdepimLibs-4.2.85 in my installation. Why are these files version-
numbered anyways?

Thiago Macieira - thiago (AT) - thiago (AT)
  Senior Product Manager - Nokia, Qt Software
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : 

More information about the Kde-buildsystem mailing list