[CMake] creating a shared and static library of the same name

Michael Biebl mbiebl at gmail.com
Mon May 15 08:52:06 EDT 2006


On 5/15/06, William A. Hoffman <billlist at nycap.rr.com> wrote:
> At 06:43 AM 5/15/2006, Michael Biebl wrote:
> >Hi everybody,
> >
> >is it possible to create a shared and static library with the same name?
> >I tried the folllowing:
> >
> >ADD_LIBRARY(foo SHARED foo.c)
> >
> >ADD_LIBRARY(foo_static STATIC foo.c)
> >SET_TARGET_PROPERTIES(foo_static PROPERTIES OUTPUT_NAME foo)
> >
> >But if I then add
> >
> >ADD_EXECUTABLE(bar bar.c)
> >TARGET_LINK_LIBRARIES(bar foo)  (I want to link it dynamically against
> >libfoo.so)
>
>
> What version of cmake are you using?  This is only supported in 2.4 and greater.
>

I'm currently using 2.4.1 (and I get this error message with 2.4.1)
but it also has to work with 2.2.

Michael


More information about the CMake mailing list