cmake problems in KDELibs4Config

Alexander Neundorf neundorf at kde.org
Thu Jul 25 16:29:26 UTC 2013


On Thursday 25 July 2013, Sebastian Kügler wrote:
> Hi Alex,
> 
> On Wednesday, July 24, 2013 22:27:46 Alexander Neundorf wrote:
> > On Wednesday 24 July 2013, Alexander Neundorf wrote:
> > > What to do...
> > > 
> > > So, kde4support depends on a lot of stuff in kdelibs.
> > > Some libs in kdelibs still depend on kde4support (at least last week
> > > this still was the case). That's why kde4support is still not
> > > installed separately.
> > > 
> > > So the KDE4Attic targets needs to exist before KDELibs4 is searched.
> > > 
> > > > Adding KDE4Attic to the KF5 modules doesn't help, what to do?
> > > 
> > > What exactly did you do ?
> 
> I added KDE4Attic in the find_package(KF5... call in plasma-
> framework/CMakeLists.txt). That yields a "can't find KDE4Attic.
> 
> > > If you add KDE4Attic to the list of known frameworks in
> > > extra-cmake-modules, and add it to the find_package(KF5 .... ) call as
> > > a needed component, it should work.
> > 
> > No, won't work.
> > kde4support depends on kde4attic, kde4attic depends e.g. on kdeui and
> > kdecore. So there are cyclic dependencies.
> > The kde4attic targets must not yet be exported into a separate file, but
> > must  still stay in the KDE4LibraryTargets.cmake file.
> 
> I don't see where and how to add it there, tried a few combinations, but
> I'm very much in the dark how these things work (your explanations help a
> bit, so thanks for that!), and what exactly I need to add, in which order,
> making it quite cumbersome (and so far without success).
> 
> I understand that I should change CreateKDELibsDependenciesFile.cmake then,
> to include KDE4_kde4attic? You say the KDE4Attic files must not be
> exported,

No, must not be exported separately from the rest of kdelibs, because there 
are dependencies from kdelibs to kde4attic, and from kde4attic to kdelibs.
Which leads to the problem that when a separately installed kde4attic is 
fodund before kdelibs, the required libs from kdelibs do not yet exist, and 
doing it the other way round, first searching kdelibs, then kde4attic, the 
kde4attic is missing for those parts in kdelibs which depend on it.

So both kde4attic and the rest of kdelibs must be in the same export.
I.e. there where install(TARGETS KDE4Attic EXPORT <exportSet> ...)
is called, the same <exportSet> must be used as for the rest of kdelibs.

In KDE4AtticConfig.cmake, no targets will be imported, but it can check that 
the target "KDE4__KDE4Attic" exists (the "KDE4__" prefix is used as namespace 
when exporting from kdelibs), and if so,
set(KDE4Attic_LIBRARIES KDE4__KDE4Attic)
and fail otherwise with the error message that KDELibs needs to be found 
first.

That way for the user it would just work, and he shouldn't notice the 
transition at all.

> I do have cmake/KDE4Attic installed along with all the other
> frameworks, so that's wrong then? OTOH, if it's not installed,
> plasma-framework/CMakeLists.txt will not be able to find it. (And if it's
> installed, it's still not found -- that's probably what you're hinting
> at.)
> 
> People *really* need to build also plasma-framework before committing such
> changes to kdelibs[frameworks]. At this point, I'm spending half of my time
> just picking up build breakage from others. I'm having a really hard time
> catching up, plasma-framework hasn't built once, this entire week, and it's
> blocking people from contributing.

Kevin said he's working on it so, so I'm not.

Alex


More information about the Kde-frameworks-devel mailing list