[CMake] Fwd: Build shared and static in one build

Eric Noulard eric.noulard at gmail.com
Fri May 18 17:37:16 EDT 2012


2012/5/18 Totte Karlsson <totte at dunescientific.com>:
>>
>> set(LIBSRC blah.c bouh.c)
>>
>> add_library(MyLib SHARED ${LIBSRC})
>>
>> add_library(MyLib-static STATIC ${LIBSRC})
>> set_target_properties(MyLibStatic PROPERTIES OUTPUT_NAME MyLib)
>>
>> should work
>
>
> That works great.
>
> Not sure what the line
>> set_target_properties(MyLibStatic PROPERTIES OUTPUT_NAME MyLib)
> Is doing?
>
> Did you mean
> set_target_properties(MyLib-static PROPERTIES OUTPUT_NAME MyLib)

yes right. missing "-" is a typo.

> and then that overwrites the dynamic link library lib?

shouldn't be overwritten because the extension (.a) should not be the
same as for dynamic (.dll / .so )


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list