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

Mike Jackson mike.jackson at bluequartz.net
Mon Sep 22 17:32:14 EDT 2008


You will probably have to set your own variable into the cache and  
then check that variable later on in your scripts

---
Mike Jackson - Principal Software Engineer
www.bluequartz.net




On Sep 22, 2008, at 5:23 PM, Aleksander Demko wrote:

> 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.
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list