COMPILE_DEFINITIONS.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. COMPILE_DEFINITIONS
  2. -------------------
  3. Preprocessor definitions for compiling a directory's sources.
  4. This property specifies the list of options given so far to the
  5. :command:`add_definitions` command.
  6. The ``COMPILE_DEFINITIONS`` property may be set to a semicolon-separated
  7. list of preprocessor definitions using the syntax ``VAR`` or ``VAR=value``.
  8. Function-style definitions are not supported. CMake will
  9. automatically escape the value correctly for the native build system
  10. (note that CMake language syntax may require escapes to specify some
  11. values).
  12. This property will be initialized in each directory by its value in the
  13. directory's parent.
  14. CMake will automatically drop some definitions that are not supported
  15. by the native build tool. The VS6 IDE does not support definition
  16. values with spaces (but NMake does).
  17. .. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
  18. Contents of ``COMPILE_DEFINITIONS`` may use "generator expressions" with
  19. the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
  20. manual for available expressions. See the :manual:`cmake-buildsystem(7)`
  21. manual for more on defining buildsystem properties.
  22. The corresponding :prop_dir:`COMPILE_DEFINITIONS_<CONFIG>` property may
  23. be set to specify per-configuration definitions. Generator expressions
  24. should be preferred instead of setting the alternative property.