[CMake] Problem with ADD_DEFINITIONS

Yann Renard yann.renard.mailing-lists at tiscali.fr
Mon Mar 26 04:02:22 EST 2007


Kishore, Jonnalagadda (IE10) wrote:
>> I have problems with ADD_DEFINITIONS : I have two target in my
>> CMakeLists which I'd like to have different -D flags. If I add
>> ADD_DEFINITIONS, it seems like both targets are affected. How coul I
> do
>> such thing ?
> 
> You have two options.
> 
> 1) Set target specific definitions using the command
> SET_TARGET_PROPERTIES
> 2) Use the ADD_DEFINITIONS before the first target is declared. After
> declaring the target, do a REMOVE_DEFINITIONS passing the same arguments
> as passed previously with ADD_DEFINITIONS. Then again ADD_DEFINITIONS
> needed for the next target and so on...
> 
> The first option is in IMHO a better option in most cases.
> 
> Warm regards,
> Kishore

Works with SET_TARGET_PROPERTIES, thank you !

Best regards,
Yann Renard


More information about the CMake mailing list