[CMake] Can I make both(STATIC & SHARED) type libraries?

Jong-young Park eminency at gmail.com
Fri Mar 2 03:55:26 EST 2007


I tested it.
However, compiling was made twice(for example, 'gcc -c a.c' is performed
twice for shared and static).

I feel some... disappointed. :)

Thanks for replying, Brandon.


On 3/2/07, Brandon J. Van Every <bvanevery at gmail.com> wrote:
>
>  Jong-young Park wrote:
>
> I need both lib.a & lib.so as project result.
> But ADD_LIBRARY command may support Only 1 type, I think.
>
> Not any other method?
>
> Thanks for reading.
>
> ]
> You will have to do ADD_LIBRARY twice, once for the shared, once for the
> static.  You'll have to give them different target names.  They can have the
> same rootname, i.e. libfoo.a and libfoo.dll.a are possible.  But CMake
> must have a unique name for each target.  I typically choose target names
> like libfoo and libfoo-static.
>
>
> Cheers,
> Brandon Van Every
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070302/2ad42824/attachment.htm


More information about the CMake mailing list