INTERFACE_SOURCES
Added in version 4.4.
List of interface sources to compile into consuming targets. The target_sources() command sets or adds to the INTERFACE_SOURCES file set property for the file sets defined with the PUBLIC or INTERFACE keyword and is the usual way to manipulate it.
Contents of INTERFACE_SOURCES may use generator expressions.
Each file must be in one of the base directories, or a subdirectory of one of the base directories.
If relative paths are specified, they are considered relative to the target's source directory.
The following behavior applies for the SOURCES and INTERFACE_SOURCES file set properties, dependent on the value of the SCOPE file set property:
-
PRIVATE -
Only the
SOURCESproperty can be set. Any change to theINTERFACE_SOURCESproperty will be ignored. -
PUBLIC -
SOURCESandINTERFACE_SOURCESproperties will always have the same content. -
INTERFACE -
Only the
INTERFACE_SOURCESproperty can be set. Any change to theSOURCESproperty will be ignored.
© 2000–2026 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/latest/prop_fs/INTERFACE_SOURCES.html