INTERFACE_COMPILE_DEFINITIONS — CMake 4.4.0 Documentation

# INTERFACE_COMPILE_DEFINITIONS

Added in version 4.4.

List of public compile definitions requirements for a file set.

File sets may populate this property to publish the compile definitions required to compile the sources for the target. The `set_property(FILE_SET)` command populates this property.

When target dependencies are specified using `target_link_libraries()`, CMake will read this property from file sets of all target dependencies to determine the build properties of the consumer. These build properties are only applied to the sources of the file sets. The other sources of the consumer are unaffected.

Contents of `INTERFACE_COMPILE_DEFINITIONS` may use "generator expressions" with the syntax `$<...>`. See the `cmake-generator-expressions(7)` manual for available expressions. See the `cmake-buildsystem(7)` -manual for more on defining buildsystem properties.

Related properties:

- Use `INTERFACE_COMPILE_OPTIONS` to pass additional compile flags.

- Use `INTERFACE_INCLUDE_DIRECTORIES` to pass additional include directories.