target_link_libraries not linking requested libraries?

Alexander Neundorf neundorf at kde.org
Mon Apr 3 22:08:55 CEST 2006


On Sunday 02 April 2006 15:51, William A. Hoffman wrote:
> 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 )

This should be changed from  ... kdesu to ${KDE4_KDESU_LIBS} ), then it should 
work AFAIK.
I commited the fix to kdelibs, kdelibs_snapshot and kdebase.

> >> 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.

Yes, if the two targets are in the same project.
libkdesu comes from kdelibs, kdesu lives in kdebase.

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net


More information about the Kde-buildsystem mailing list