Howto fix KDE4 Buildsystem with CMake CVS

Andreas Pakulat apaku at gmx.de
Mon Jan 28 10:32:15 CET 2008


Hi,

CMake CVS changed some behaviour in how it treats
target_link_directories. Specifically it now doesn't -L switches to the
linker call unless one explicitly calls link_directories() and sets the
needed paths.

This breaks building any module in KDE4 (except kdelibs) because we get
some libraries with absolute path in the KDE_XXX_LIBS variables. Easiest
way to reproduce is building kdelibs + kdepimlibs with cmake cvs. It
will error out on linking kresources, because it doesn't find -lsolid.
The linker line doesn't contain any -L switches, but some libraries like
QtCore, kdecore and other are referenced with absolute paths which
works.

There are a couple of ways to fix this:

a) introduce KDE_XXX_LIBRARY_DIR (or KDE_LIBRARY_DIR) and add
link_directories calls for kde libdir and qt libdir in all
CMakeLists.txt all over trunk/.

pro: clean solution
con: takes quite some time and effort

b) call link_directories for KDE libdir and Qt libdir in
FindKDE4Internal.

pro: also relatively clean
con: needs adjustments still in FindKDEPimLibs and also
FindKDevPlatform. Hides some things from the cmakefile-writer.

c) set CMAKE_BACKWARDS_COMPATIBILITY to 2.4 or activate
CMAKE_LINK_OLD_PATHS in FindKDE4Internal.cmake

pro: works without any modifications anywhere else
con: ugly workaround IMHO

Opinions? Better Ideas?

Andreas

-- 
You will be Told about it Tomorrow.  Go Home and Prepare Thyself.


More information about the Kde-buildsystem mailing list