Fwd: KDE/kdebase/libkonq

William A. Hoffman billlist at nycap.rr.com
Thu Mar 2 15:39:04 CET 2006


At 09:25 AM 3/2/2006, Christian Ehrlicher wrote:

>I don't think this is needed on win32 - otherwise we would had to link
>kdelibs against win32 system libs what we're not doing.

Actually, that happens from some other magic.  MSVC puts pragma's in its
header files that cause the linker to link to files.  (Which is the reason
you can not mix debug and release).   

CMake does however do the library chaining for you.

So, if you tell cmake all the libraries that your library directly uses,
it will chain those libraries to any library that use your library.
For example:

add_library(A ...)
target_link_libraries(A B C)

add_library(D ...)
target_link_libraries(D A)  # D will link to A B C

add_executable(foo ...)
target_link_libraries(foo D)  # foo will link to D A B C

This is also important if you ever want static linking to work,
since static libraries never pull in the libraries they use automatically.

-Bill




More information about the Kde-buildsystem mailing list