overriding CMAKE_MODULE_PATH

Yury G. Kudryashov urkud at ya.ru
Mon Aug 16 15:03:05 CEST 2010


Christophe Giboudeaux wrote:

> Hi,
> 
> Le 16/08/2010 12:20, Michael Jansen a écrit :
>> 2. KDE installs a ton of useful not kde related FindXYZ*.cmake files
>> into a path != /usr/share/cmake... . If a non kde project wants to use
>> it (even a small homegrown project) the user has to set
>> CMAKE_MODULE_PATH from the outside. Therefore he needs the line from
>> Yury in his CMakeLists.txt. Since we as kde are the poster child for
>> cmake usage we should implement our cmake files as examples for other to
>> copy.
> 
> This is exactly what CMAKE_PREFIX_PATH does: give the order in which
> CMake looks for stuff. There's no need for this hack.
> 
>> 
>> 3. If someone develops a small lib he plans to add as a kde dependency
>> he probably installs it into some non distro prefix so he doesn't need
>> root rights to install it. So he needs to override CMAKE_MODULE_PATH in
>> say koffice to make it pick up that location. And i would expect it to
>> work. Remember that his KDELIBS_PREFIX could be distro provided and
>> koffice is installed into /usr/local/ .
>> 
> 
> Once again, CMAKE_PREFIX_PATH is enough. Here's an example:
> 
> # echo $CMAKE_PREFIX_PATH
> /kde/inst/akonadi:/kde/inst/extragear-
network:/kde/inst/kdepim:/kde/inst/kdepimlibs:/kde/inst/kdepim-
runtime:/kde/inst/pim
> 
> and CMake ran in kdenetwork has no problem to find libktorrent:
> 
> -- Found libktorrent: /kde/inst/extragear-network/lib64/libktorrent.so
This is not because of CMAKE_PREFIX_PATH but because of KDEDIRS. KDE 
buildsystem adds
map (x: x + "/share/apps/cmake/modules") $KDEDIRS
to CMAKE_MODULE_PATH.

So I will just set $KDEDIRS while building. Thanks.
> 
> WRT to the original post, there are two issues:
> - libktorrent should not install FindKtorrent.cmake since it's supposed
> to help finding libktorrent and not ktorrent,
> 
> - It should install a LibKtorrentConfig.cmake instead of a FindXXX.cmake
> for the reasons Andreas already gave.
Say it to ktorrent developers, please. I'm just trying to package kdenetwork 
for a small distro.



More information about the Kde-buildsystem mailing list