You can use:

set_target_properties(${target}-static PROPERTIES COMPILE_DEFINITIONS RR_STATIC)

For full details, run:

cmake --help-property COMPILE_DEFINITIONS

Cheers,
Fraser.


On 12/06/2012 23:39, Totte Karlsson wrote:
Hi,
I have a CMakeLists.txt that creates both a shared and static lib.
In short it looks something like this:

add_definitions(-DEXPORT_RR)
add_library(${target}         SHARED ${rrSources})
add_library(${target}-static     STATIC ${rrSources})


The problem being that for the static version, the flag
-DRR_STATIC should be defined.

How can one achieve that?

-totte

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to