COMPILE_DEFINITIONS.rst 1.1 KB

12345678910111213141516171819202122232425
  1. COMPILE_DEFINITIONS
  2. -------------------
  3. Preprocessor definitions for compiling a target's sources.
  4. The ``COMPILE_DEFINITIONS`` property may be set to a semicolon-separated
  5. list of preprocessor definitions using the syntax ``VAR`` or ``VAR=value``.
  6. Function-style definitions are not supported. CMake will
  7. automatically escape the value correctly for the native build system
  8. (note that CMake language syntax may require escapes to specify some
  9. values).
  10. CMake will automatically drop some definitions that are not supported
  11. by the native build tool.
  12. .. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
  13. Contents of ``COMPILE_DEFINITIONS`` may use "generator expressions" with the
  14. syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
  15. for available expressions. See the :manual:`cmake-buildsystem(7)` manual
  16. for more on defining buildsystem properties.
  17. The corresponding :prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` property may
  18. be set to specify per-configuration definitions. Generator expressions
  19. should be preferred instead of setting the alternative property.