[CMake] Toggling a Preprocessor macro for targets within a single project

Eric Noulard eric.noulard at gmail.com
Fri Feb 20 04:59:34 EST 2009


2009/2/20 Christian Ehrlicher <Ch.Ehrlicher at gmx.de>:
>> Von: Andreas Pokorny
>> Hello,
>> Wow that was fast. Thanks a lot.

Obviously I was too fast reading the doc :-)

>> > [...]
>> >
>> > SET_TARGET_PROPERTIES(PlatformLib PROPERTIES
>> >                                             DEFINE_SYMBOL USE_TRACER)
>> >
>> > Then you shouldn't have to ADD_DEFINITIONS and REMOVE_DEFINITIONS?
>>
>>
>> I do not understand why.. but DEFINE_SYMBOL did not work, but
>> COMPILE_FLAGS -DUSE_TRACER
>> did. So SET_TARGET_PROPERTIES is the sledgehammer for getting it done :)
>>
> DEFINE_SYMBOL only works for shared libraries. see cmake documentation: "DEFINE_SYMBOL sets the name of the preprocessor symbol defined when compiling sources in a shared library."

Thank you  Christian
...for reading the doc more carefully  than I do :-)


-- 
Erk


More information about the CMake mailing list