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