1CMP0043 2------- 3 4Ignore COMPILE_DEFINITIONS_<Config> properties 5 6CMake 2.8.12 and lower allowed setting the 7:prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` target property and 8:prop_dir:`COMPILE_DEFINITIONS_<CONFIG>` directory property to apply 9configuration-specific compile definitions. 10 11Since CMake 2.8.10, the :prop_tgt:`COMPILE_DEFINITIONS` property has supported 12:manual:`generator expressions <cmake-generator-expressions(7)>` for setting 13configuration-dependent content. The continued existence of the suffixed 14variables is redundant, and causes a maintenance burden. Population of the 15:prop_tgt:`COMPILE_DEFINITIONS_DEBUG <COMPILE_DEFINITIONS_<CONFIG>>` property 16may be replaced with a population of :prop_tgt:`COMPILE_DEFINITIONS` directly 17or via :command:`target_compile_definitions`: 18 19.. code-block:: cmake 20 21 # Old Interfaces: 22 set_property(TARGET tgt APPEND PROPERTY 23 COMPILE_DEFINITIONS_DEBUG DEBUG_MODE 24 ) 25 set_property(DIRECTORY APPEND PROPERTY 26 COMPILE_DEFINITIONS_DEBUG DIR_DEBUG_MODE 27 ) 28 29 # New Interfaces: 30 set_property(TARGET tgt APPEND PROPERTY 31 COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG_MODE> 32 ) 33 target_compile_definitions(tgt PRIVATE $<$<CONFIG:Debug>:DEBUG_MODE>) 34 set_property(DIRECTORY APPEND PROPERTY 35 COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DIR_DEBUG_MODE> 36 ) 37 38The ``OLD`` behavior for this policy is to consume the content of the suffixed 39:prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` target property when generating the 40compilation command. The ``NEW`` behavior for this policy is to ignore the content 41of the :prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` target property . 42 43This policy was introduced in CMake version 3.0. CMake version 44|release| warns when the policy is not set and uses ``OLD`` behavior. Use 45the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. 46 47.. include:: DEPRECATED.txt 48