COMPILE_DEFINITIONS.rst 1.3 KB

12345678910111213141516171819202122232425262728293031
  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.
  16. .. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
  17. Contents of ``COMPILE_DEFINITIONS`` may use "generator expressions" with
  18. the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
  19. manual for available expressions. See the :manual:`cmake-buildsystem(7)`
  20. manual for more on defining buildsystem properties.
  21. The corresponding :prop_dir:`COMPILE_DEFINITIONS_<CONFIG>` property may
  22. be set to specify per-configuration definitions. Generator expressions
  23. should be preferred instead of setting the alternative property.