Finding kf5 libs (Re: Move kde-config to kde4support.)

Alexander Neundorf neundorf at kde.org
Fri Feb 22 17:54:45 UTC 2013


On Friday 22 February 2013, David Faure wrote:
> [This is no longer about kde*-config, retitling]
> 
> On Friday 22 February 2013 18:38:39 Alexander Neundorf wrote:
> > If you do
> > find_package(KF5 COMPONENTS kidletime kauth kconfig)
> > it will search the kidletime library, and once it has found it, it will
> > search kauth and kconfig only in the same prefix.
> 
> Surely if it can find kidletime "anywhere" (I assume that's more precisely
> "in CMAKE_PREFIX_PATH"), it can find the others using the same algorithm?
> 
> > If KDEDIRS is set, it searches afterwards also in those.
> 
> Please get rid of KDEDIRS. Surely setting CMAKE_PREFIX_PATH can do this job
> just the same?

No, it can't.
If you set it to /opt/mykf5/, cmake will search stuff there, and afterwards in 
the standard locations, so you may get a mixture of libs.

> > Or am I wrong with this, will the libraries have potentially completely
> > individual version dependencies ?
> 
> We will release them all at once, but on a given system, after some apt-
> get/zypper usage, you could end up with a different version installed for
> independent libs. Dependent libs should have proper version requirements
> though (kservice 5.1 requires ki18n >= 5.1).

Let's ignore the tier1 libs with no interdependencies, they are no problem.
Still, packages installed via apt-get/zypper will be packages built by the 
distribution, so that they work together. They will all be in the system 
directories. This is the easy case.

This is not what kf5 is about.
It is to make it easier for other developers to use some subset of the kf5 
libs.
Making it easy to separate different installations of kf5 on the same system 
from each other helps with this.

> > Imagine the following: my system has kf 5.3 installed, and for some
> > project I want to use a subset of the kf5 libraries, let's say sonnet
> > and kconfig, with all their dependencies, from 5.5.
> > I would want to install those into a separate prefix, e.g.
> > /opt/my-kf5-5.5/, and when using it, I would want to make sure I get just
> > what is installed there, and not any other versions mixed in.
> > 
> > This works as it is now:
> > find_package(KF5 MODULE COMPONENTS KConfig Sonnet)
> > It will find KConfig and Sonnet only from the same directory, which will
> > be the prefix I installed them to.
> > If I want to mix different prefixes, I can use KDEDIRS (or could be
> > KF5DIRS). Or I can use them as independent libraries:
> > find_package(Sonnet NO_MODULE)
> > find_package(KConfig NO_MODULE)
> > 
> > IMO this will make using the kf5 libs easier, and keeps us a bit from
> > dependency hell. Why should we give this up ?
> 
> I agree with the goal. But don't we achieve the same goal with
> CMAKE_PREFIX_PATH pointing to /opt/my-kf5-5.5 so that anything that can be
> found there is preferred over anything in /usr ?

As I said above, no.

Alex


More information about the Kde-frameworks-devel mailing list