changes to how kdepimlibs and kdebase/workspace are installed and found

Brad King brad.king at
Tue Dec 9 22:16:31 CET 2008

Alexander Neundorf wrote:
> On Tuesday 09 December 2008, Modestas Vainius wrote:
>> Hello,
>> antradienis 09 Gruodis 2008, Brad King rašė:
>>> I've fixed this in CMake HEAD:
>>> /cvsroot/CMake/CMake/Source/cmFindPackageCommand.cxx,v  <--
>>> Source/cmFindPackageCommand.cxx
>>> new revision: 1.52; previous revision: 1.51
>> Thank you for such quick response and fix. Now I wish Alex could add
>> support for this path to KDE. /usr/lib/Kdepimlibs and
>> /usr/lib/KDE4Workspace currently contains only cmake stuff which are
>> "found" via
>> cmake/modules/Find{Kdepimlibs,KDE4Workspace}.cmake anyway. So it is easy to
>> workaround lack of native cmake support for this path in 2.6.2.
> So we'll have to do something like:
>    set(configInstallDir ${LIB_INSTALL_DIR}/cmake/kfoo)
> else ()
>    set(configInstallDir ${LIB_INSTALL_DIR}/kfoo/cmake)
> endif ()

Unfortunately the version of CMake that is doing the *finding* needs to 
be higher than 2.6.2 in order for the cmake/kfoo path to work.  The 
version doing the installing does not matter.  Often they will be the 
same cmake, but sometimes not.

Perhaps you can avoid this by using PATH_SUFFIXES on the inner 
find_package call in your find-modules:

   find_package(KFoo NO_MODULE PATH_SUFFIXES cmake)

Then you can just always install to cmake/kfoo.  Once a version of CMake 
supporting this location is required in the future this suffix can be 

> Should we include the version number ?
>    set(configInstallDir ${LIB_INSTALL_DIR}/kfoo-x.y.z/cmake)

or perhaps

   set(configInstallDir ${LIB_INSTALL_DIR}/cmake/kfoo-x.y.z)

?  Anyway, yes, I think the version number should be on the directory. 
This will help support multiple KDE versions in the same prefix.  Even 
if that is not a design goal, having the version number in the path does 
not affect CMake's ability to find the package.  It may also give more 
information when helping users remotely.

> Brad: is this version number considered when specifying a minimum version for 
> the package or is it ignored and only a fooVersion.cmake file will be used ?

The latter.  The directory name is purposely and completely ignored (for 
various reasons I'll omit here).  The FooConfigVersion.cmake files are 
the only way to enforce version constraints.

I think you should put the version files in now.  If an installation 
doesn't have one, then versioned requests will not find anything because 
there is no version file to say it supports a particular version.  Once 
you have installations distributed like this it will be hard to add 
versioning later.


More information about the Kde-buildsystem mailing list