Reducing excess linkage - cmake 2.6 IMPORTED targets and LINK_INTERFACE_LIBRARIES for kdelibs

Alexander Neundorf neundorf at kde.org
Thu Jun 19 19:43:19 CEST 2008


On Thursday 19 June 2008, you wrote:
> 2008/6/18 Alexander Neundorf <neundorf at kde.org>:
> > i.e. almost empty. I don't know if these settings are ideal. There were a
> > lot of undefined references to X stuff in targets which linked to kdeui,
> > so maybe X11_LIBRARIES should be added to the link interface of kdeui.
> > There were also several errors with undefined references to libz
> > functions in targets which link to kio, so maybe libz should be added to
> > the kio link interface.
> > What do you think ?
>
> I've been watching this thread, but haven't had a chance to
> investigate how it affects OSX yet.  I can tell you that OSX doesn't
> allow undefined symbols (without some work)... 

The patch isn't about allowing undefined references, still everything must be 
resolved.
Let say you had this:

target_link_libraries(kdecore QtCore QtXml z bz2)

and later on you did:

add_executable(foo ${fooSrcs})
target_link_libraries(foo kdecore)

Then foo would be automatically linked to all libs linked to kdecore, i.e. to 
libQtCore.so, libQtXml.so, libz.so and libbz2.so.
This has changed now with the patch and foo will be only linked against 
kdecore and the libs specified in the LINK_INTERFACE_LIBRARIES target 
property.

> do you know if anyone's tested this stuff with mac yet?  Is it easy to turn
> off?  =)

Right now it is off by default, but I'd like to change that. I tried it two 
weeks ago with a Mac and it seemed to behave just the same way. But you 
better try yourself.

Alex


More information about the Kde-buildsystem mailing list