Reduced link interface - now for real

Alexander Neundorf neundorf at kde.org
Tue Nov 18 22:42:45 CET 2008


On Tuesday 18 November 2008, Alexander Neundorf wrote:
> On Tuesday 18 November 2008, Alexander Neundorf wrote:
> > (*1). Well, it is empty by default if the option
> > KDE4_ENABLE_EXPERIMENTAL_LIB_EXPORT is TRUE. This is the case for
> > kdelibs, for all other modules it is still FALSE by default.
>
> ...
>
> > AND
> > enable the aforementioned KDE4_ENABLE_EXPERIMENTAL_LIB_EXPORT manually in
> > your build tree. Once you are sure enough that everything works, enable
> > it fix, e.g. by putting a
> > set(KDE4_ENABLE_EXPERIMENTAL_LIB_EXPORT  TRUE)
> > in the top level CMakeLists.txt, it must be after find_package(KDE4).
>
> Ignore all what I wrote about KDE4_ENABLE_EXPERIMENTAL_LIB_EXPORT, it's
> wrong. (all the rest is correct).

Sorry for the confusion, ignore the "ignore all" email, my initial, first 
email is indeed fully correct.

Details: 
target_link_libraries(<target> LINK_INTERFACE_LIBRARIES <lib1>...<libN>)
initializes the LINK_INTERFACE_LIBRARIES target property to empty and then 
adds lib1 to libN. Additional calls to target_link_libraries(... 
LINK_INTERFACE_LIBRARIES ...) add more libraries to the link interface. So 
once you use target_link_libraries(... LINK_INTERFACE_LIBRARIES ...), you get 
just what you want. If you forget to use it, you still have the full list of 
libraries as your default link interface. 
Now, if you enable KDE4_ENABLE_EXPERIMENTAL_LIB_EXPORT, the default is changed 
from the full list to empty, and I think this is indeed what we want 
(otherwise people will forget to set it and we will have the long dependency 
lists again).

/me should get some sleep

Alex


More information about the Kde-buildsystem mailing list