Split building

Piotr Jaroszyński p.jaroszynski at gmail.com
Mon Jan 7 21:23:36 CET 2008


On Monday 07 of January 2008 20:26:58 Alexander Neundorf wrote:
> > 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 ?

Definitely.

> 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.

This looks really promising, just did a simple test and e.g. for split libkonq 
build I get:
SET(konq_LIB_DEPENDS ... )
SET(konq_sound_LIB_DEPENDS ... )
SET(kded_favicons_LIB_DEPENDS ... )

All (or select) split packages could append to one file with deps and also 
include it(or its copy) at the same time. Shouldn't that work?

-- 
Best Regards,
Piotr Jaroszyński


More information about the Kde-buildsystem mailing list