[CMake] Changing definitions at compile time

Kfir Lavi lavi.kfir at gmail.com
Tue Jun 14 12:12:16 EDT 2011


Hi,
I need to compile the code twice. Once with -DA and once with -DB
My code look like this:
add_definitions(-DA)
add_library(${mylib_A} SHARED ${myfiles})
remove_definitions(-DA)

add_definitions(-DB)
add_library(${lib_B} SHARED ${myfiles})
remove_definitions(-DB)

What cmake does is to define A and then remove it, so in compile time, there

is now definition of A or B.

How do I tell cmake that the remove needs to  be in compile time?

Regards,
Kfir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110614/bcc68c92/attachment.htm>


More information about the CMake mailing list