COMPILE_DEFINITIONS.rst 1.1 KB

1234567891011121314151617181920212223242526
  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. The VS6 IDE does not support definition
  12. values with spaces (but NMake does).
  13. .. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
  14. Contents of ``COMPILE_DEFINITIONS`` may use "generator expressions" with the
  15. syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
  16. for available expressions. See the :manual:`cmake-buildsystem(7)` manual
  17. for more on defining buildsystem properties.
  18. The corresponding :prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` property may
  19. be set to specify per-configuration definitions. Generator expressions
  20. should be preferred instead of setting the alternative property.