target_link_libraries not linking requested libraries?

William A. Hoffman billlist at nycap.rr.com
Sun Apr 2 15:51:24 CEST 2006


At 01:00 AM 4/2/2006, Tanner Lovelace wrote:
>On 4/1/06, Benjamin Reed <rangerrick at gmail.com> wrote:
>> When building kdesu, for some reason it's not linking against -lkdesu.
>>  The CMakeFile.txt in kdesu/kdesu specifies:
>>
>> ---(snip!)---
>> set(kdesu_SRCS kdesu.cpp sudlg.cpp )
>> kde4_automoc(${kdesu_SRCS})
>> kde4_add_executable(kdesu ${kdesu_SRCS})
>> target_link_libraries(kdesu ${KDE4_KIO_LIBS} kdesu )
>> install_targets(/bin kdesu )
>> ---(snip!)---
>
>I seem to remember CMake having problems when two
>targets have the same name.  Perhaps the library
>kdesu target needs to have a different name or just
>use the sources from the kdesu library?  If I recall
>correctly, even if the target has a different name, you
>can set the output name to still be libkdesu.

That is correct, two targets can not have the same name.
You can set a target property OUTPUT_NAME to change the
name of the thing that is created.  This is to support
IDE's like visual studio that do not support two targets with
the same name.

-Bill



More information about the Kde-buildsystem mailing list