Providing FindFoo.cmake for a kde module "foo"

Andreas Pakulat apaku at gmx.de
Sun Jul 8 23:56:32 CEST 2007


On 08.07.07 20:26:34, Andreas Pakulat wrote:
> On 08.07.07 19:31:49, Andreas Pakulat wrote:
> > On 08.07.07 11:06:32, Matt Rogers wrote:
> > > On Jul 8, 2007, at 9:35 AM, Andreas Pakulat wrote:
> > > > due to a problem (I'd call it a bug actually) in cmake its not  
> > > > possible
> > > > to install 2 kde modules where one depends on the other into separate
> > > > directories (and separate directories from kdelibs). For packaging KDE
> > > > module's however its needed that each module is installed into its own
> > > > prefix.
> > > 
> > > You'll need to explain this more clearly. I have no idea what you're  
> > > talking about. IIRC, all of KDE needs to be installed in the same  
> > > prefix.
> > 
> > That would be a regression over KDE3 and is not needed at all (there
> > have recently been some fixes to allow this in the buildsystem).
> 
> Ooops, forgot about the more clearly part :)
> 
> But during some trials with cmake it turns out that one can tell cmake
> its CMAKE_MODULE_PATH even providing multiple paths:
> 
> cmake -DCMAKE_MODULE_PATH="/dir1;/dir2"
> 
> So actually this is a non-issue

Seems like I have to correct myself. It only worked because the
CMakeLists.txt involved actually used

set(CMAKE_MODULE_PATH <some-other-path> ${CMAKE_MODULE_PATH})

so thats why one could supply CMAKE_MODULE_PATH on the commandline.

So the real issue still stands and I'm going to again explain it in all
depth.

Lets say I have kdelibs, kdevplatform and kdevelop and want to install
all three of them into separate directories. kdelibs is installed via
distro packages (lets pretend we're a year in the future) but as I want
to work on kdevplatform and kdevelop I build these two myself and I'm
putting them in different dirs to ease deletion of one of them.

So now I've got a problem, kdelibs is found easily by cmake when
configuring kdevelop, but kdevplatform is not because it installs its
FindKDevPlatform.cmake into
$HOME/kdevplatform/share/apps/cmake-2.4/Modules (path may differ in
reality).

Now I'd have to put something like

set(CMAKE_MODULE_PATH
/home/andreas/kdevplatform/share/apps/cmake-2.4/Modules) 

into KDevelop's top-level CMakeLists.txt - not straight forward.

Another Option that Ralf turned up is providing KDevPlatformConfig.cmake
with such a set(), which as far as I can see is the only way. But it
still needs giving cmake
-DKDevPlatform_DIR=$HOME/kdevplatform/share/cmake/modules so it can
actually find the KDevPlatformConfig.cmake. 

This latter thing is not required if you have the Config.cmake in
kdelibs/lib/kdevplatform, but as said above kdelibs is a distro package
and thus kdevplatform can't install it in such a location.

So far my conclusion is: Only workaround that works half-way is the
Config.cmake, or am I missing anything?

Andreas

-- 
You will experience a strong urge to do good; but it will pass.


More information about the Kde-buildsystem mailing list