Separate building of subprojects inside modules Was: Re: Okular moving

Alexander Neundorf neundorf at
Tue Nov 21 20:50:12 GMT 2006

On Tuesday 21 November 2006 21:06, Leo Savernik wrote:
> Am Dienstag, 21. November 2006 01:34 schrieb Gary L. Greene, Jr.:
> > On Monday 20 November 2006 19:31, Alexander Neundorf wrote:
> > > On Monday 20 November 2006 21:05, Leo Savernik wrote:
> > > > KEG has become way too big to install it as a whole. Given how bitchy
> > > > it is to extract out a single app and build it (has this improved
> > > > with cmake?),
> > >
> > > If everything's done right, it should be quite easy.
> > > Just remove all top-level subdirs you don't need and remove the
> > > corresponding add_sudirectory() calls in the toplevel CMakeLists.txt.
> > > This should be really all.
> > > But I think nobody tried yet.
> > >
> > > Bye
> > > Alex
> >
> > I think what Leo means is some more automatic way of doing it so the user
> > building it won't screw it up...
> What I mean is more like this:
> cd k3b
> cmake && make && make install

It can be made work this way, but currently this isn't the case.
What has to be done to make it work:
-CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR may not be used, since they refer to 
different directories depending on what is the base directory of the project 
(i.e. keg/ vs. keg/k3b/). Instead PROJECT(k3b) has to be used and then 
k3b_SOURCE_DIR and k3b_BINARY_DIR instead.

- no module-global config.h may be used, instead all the required system 
introspection has to be done inside keg/k3b/

-it may not be relied on find_package() commands outside of keg/k3b/, i.e. 
also not find_package(KDE4 REQUIRED). This would mean that find_package(KDE4 
REQUIRED) would have to be repeated in every subproject. Many things are 
cache by cmake, so this might be not such a big performance hit.

What can be done right now is:
$ cd keg
$ cmake .
$ cd k3b
$ make; make install

Will be k3b and everything required to build k3b.

I could also create a macro like optional_add_subdirectory(k3b), which would 
do the following, in pseudo code:

   if exists(<name>)
      option(build_<name> "Build directory <name>" default=TRUE)
      if (build_<name>)

This would have the effect that you could disable everything else or also 
simply delete it.
Would that be useful ?

Work: alexander.neundorf AT -
Home: neundorf AT                -
      alex AT               -

More information about the kde-core-devel mailing list