[CMake] how do I test if a library target is static or shared?

Aleksander Demko ademko at gmail.com
Mon Sep 22 17:23:35 EDT 2008


On Mon, Sep 22, 2008 at 4:15 PM, Mike Jackson
<mike.jackson at bluequartz.net> wrote:
> Assuming you mean a library that you are creating the default is static. If
> you want a dynamic library then use the "SHARED" keyword:
>
> add_library (mylib SHARED libsource.cpp)
>

I understand that. But later in my script I want to check if mylib is
shared or static with an IF command. I want the command to know if the
add_library was the default static, shared or shared because
BUILD_SHARE_LIBS is true.


More information about the CMake mailing list