[CMake] Append to property COMPILE_DEFINITIONS

Florian Lindner mailinglists at xgm.de
Mon Jul 17 22:56:23 EDT 2017


Hello,

I want to add compile definitions. Since I want to use generator expressions, I can't use add_definitions, but have to
use the COMPILE_DEFINITIONS property, but neither:

set_property(GLOBAL APPEND
  PROPERTY COMPILE_DEFINITIONS "-DFOO")

for testing

or

set_property(GLOBAL APPEND
  PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:-DDebug>)

which should be final result, produces any -DFOO compiler switches.

I also tried placing it before and after the add_executable call.

What is wrong with that call?

Thanks,
Florian


More information about the CMake mailing list