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

Brandon J. Van Every bvanevery at gmail.com
Fri Mar 2 13:02:38 EST 2007


Alexander Neundorf wrote:
> Von: "Brandon J. Van Every" <bvanevery at gmail.com>
>
>   
>> 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.
>>     
>
> Is this already in the FAQ ?
>   

It wasn't.

> If not, can you please add it there ?
>   

Did it, and rationalized the FAQ categories while I was at it.  See
http://www.cmake.org/Wiki/CMake_FAQ#Library_questions


Cheers,
Brandon Van Every

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070302/6733e642/attachment.htm


More information about the CMake mailing list