[CMake] Cannot link to: SET_TARGET_PROPERTIES(foo PROPERTIES PREFIX "")

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Apr 26 10:58:14 EDT 2007


On 4/26/07, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> Mathieu Malaterre wrote:
> > I have a test case for using cmake to link to a non 'lib' prefix library:
> >
> > http://gdcm.svn.sourceforge.net/viewvc/gdcm/Sandbox/CMakeBug/2/
> >
> > Replicated with cmake 2.4.5 and CMake CVS
> >
> > -----
> > ADD_LIBRARY(foo SHARED foo.c)
> > SET_TARGET_PROPERTIES(foo PROPERTIES PREFIX "")
> >
> > ADD_EXECUTABLE(testfoo testfoo.c)
> > TARGET_LINK_LIBRARIES(testfoo foo)
> > -----
> >
> > How to retrieve:
> >
> > svn co https://gdcm.svn.sourceforge.net/svnroot/gdcm/Sandbox/CMakeBug/2
> >
> > should it be entered in the bug tracker ?
>  I don't think you can link to a library without a lib prefix.   Cmake
> always uses the -L -l options to link, and they require a prefix on some
> systems to work.

Hum... I'll have to be more convincing to make my coworkers move away
from Makefile, if there are things they cannot achieve anymore (gcc
seems to be tolerant so that you can pass a full path to the shared
lib, even without a lib prefix).

But I see your point, a lib should be prefixed with lib anyway.

Thanks,
-Mathieu


More information about the CMake mailing list