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

Brandon J. Van Every bvanevery at gmail.com
Fri Mar 2 03:46:37 EST 2007


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070302/8deb9eb4/attachment.html


More information about the CMake mailing list