further coinstallability

Manuel Nickschas sputnick at quassel-irc.org
Sun Dec 8 12:43:33 UTC 2013


Stephen Kelly wrote:
> Jonathan Riddell wrote:

>> but cmake files are harder e.g. /usr/lib/cmake/grantlee
>> has files
>> which they will want to be co-installable.  cmake docs say they can be
>> installed into a versioned directory e.g. /usr/lib/cmake/grantlee-5 but
>> this needs to be checked and the build system modified.
> 
> Which cmake docs say this? This doesn't ring a bell for me.

It's in the normal find_package documentation [0], where it says that CMake 
looks for config files in /various/paths/<name>*/ - notice the asterisk. So 
this means it should find a GrantleeConfig.cmake in 
/usr/lib/cmake/grantlee-5.

It further states that it then will check the *ConfigVersion.cmake file to 
find a compatible version - if the requested version is actually supplied 
with the find_package call, and if the *ConfigVersion.cmake file actually 
exists and checks for compatibility and sets the required variables.

This means that for making this work properly, we need to ensure that

a) our *ConfigVersion.cmake files behave correctly, setting the various
   PACKAGE_VERSION* variables properly
b) every find_package() call asks for a version, something like
   find_package(Solid ${FRAMEWORKS_VERSION})

Unfortunately, b) would also have to be done for KDE4 so it doesn't pick up 
KF5 libraries - although only a handful of libraries seem to use the config 
mode of CMake. I'm not very familiar with the KDE4 (or KF5, for that matter) 
build systems; wasn't it the case that there was a wrapper macro for 
find_package() that could be modified to automagically supply the requested 
version?

A short peek into my /usr/lib/cmake tells me that not every KDE4-related 
library supplies a *ConfigVersion.cmake file, but those which do seem to be 
using write_basic_package_version_file() which does implement a proper 
version check. Qt5 also behaves properly. I don't have a KF5 installation on 
my box currently, so didn't check those.

Please note that I didn't check if CMake actually behaves like the docs 
claim, so I may well be wrong with some of my statements.

Cheers,
~ Sput

[0] http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:find_package



More information about the Kde-frameworks-devel mailing list