cmake 2.6.2 now required - changes in handling shared libs

Andreas Pakulat apaku at gmx.de
Tue Nov 11 21:39:09 GMT 2008


On 11.11.08 01:00:50, Alexander Neundorf wrote:
> Hi,
> 
> as of now cmake 2.6.2 is required to build KDE4 trunk.
> 
> This brings some bugfixes, some nice features and one relatively big change, 
> which concerns shared library handling.
> 
> Warning: if you get linker errors or errors related to different build 
> types/configurations (i.e. debug vs. release etc.) please let me know .
> 
> 
> Now straight on to the big change(TM).
> 
> Short version:
> In kdelibs, when creating a shared lib, now also add the arguments
> "EXPORT kdelibsLibraryTargets" to the install(TARGETS ...) command, like this:
> 
> install(TARGETS threadweaver EXPORT kdelibsLibraryTargets
>                              ${INSTALL_TARGETS_DEFAULT_ARGS})
> 
> And to define a minimal link interface, do this:
> 
> target_link_libraries(threadweaver
>                               LINK_INTERFACE_LIBRARIES ${QT_QTCORE_LIBRARY} )
> 
> 
> Now the long version (you should read it):
> 
> The correct way to create and install a shared library is now:
> 
> kde4_add_library(kfoo SHARED ${kfooSources} ) 
> target_link_libraries(kfoo kdecore ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY})
> 
> # No changes so far, but the next line is new.
> # It specifies to which libraries other targets will be linked which 
> # link to libkfoo. By default these are all libraries kfoo links against,
> # which can lead to some unnecessary dependencies, slower startup, etc.
> # So we now specifiy which "link interface" the library kfoo has, ZLIB
> # is used only internally, so users of kfoo don't have to link against it:

So whats the plan with trunk/KDE now, who is supposed to check all the
modules and adjust the link-interface if needed?

Andreas

-- 
Don't read everything you believe.



More information about the kde-core-devel mailing list