Split building
Alexander Neundorf
neundorf at kde.org
Mon Jan 7 20:26:58 CET 2008
On Monday 07 January 2008, Piotr Jaroszyński wrote:
> On Monday 07 of January 2008 19:23:56 Alexander Neundorf wrote:
> > > Sounds like an idea.
> >
> > This will be some work. It means that developers must not use the target
> > names anymore when linking to libraries :-/
> >
> > Would it be an option for you to always also check out the library
> > directories so that these targets exist ?
> >
> > Would it be an option for you to checkout everything but enable only the
> > application you're interested in ?
> > This would mean you would have a switch BUILD_KFOO for each app, which
> > you could enable as you want. Libs would be always enabled.
> >
> > It may be possible to do something with export_library_dependencies(), so
> > you may be able to preload some stuff into cmake so it can deal with the
> > unknown lib, I have to check...
>
> Rebuilding libs for each package is not an option as Gentoo is a source
> based distributions, users would kill us :) Unpacking more stuff won't hurt
> as far as we don't build everything over and over again. Would it be
> possible to only build the package in question but make CMake use the
> targets it doesn't build (e.g. konq in the kdepasswd case)?
It is possible to "fake" that these library targets exist.
If you build e.g. complete kdebase, you will see that the CMakeCache.txt
contains a
foo_LIB_DEPENDS:STATIC=jpeg;png;
for every library target, e.g. a konq_LIB_DEPENDS.
As soon as cmake now detects the "konq" in the arguments for
TARGET_LINK_LIBRARIES() it checks of the variable konq_LIB_DEPENDS exists and
uses its contents for linking.
This means if you manage to get konq_LIB_DEPENDS set correctly when building
the kcm it will link to everything it needs.
There are two ways:
You could do something like
grep konq_LIB_DEPENDS kdebase-full-build/CMakeCache.txt >>
kdebase-kdepassword-build/CMakeCache.txt
This will put the variable directly into the cache.
Or you can create a cmake script something like this as e.g. libdeps.cmake:
set(konq_LIB_DEPENDS jpeg;png CACHE STRING "deps")
and then preload it into cmake:
cmake -C libdeps.cmake <all other options>
Does this help ?
Alex
P.S. This file can also be created automatically by using
EXPORT_LIBRARY_DEPENDENCIES(), but currently this isn't done in kdebase,
since usually the libs from kdebase are no public interface, i.e. usually
there is no need to link external apps to these libs.
More information about the Kde-buildsystem
mailing list