INTERFACE_SOURCES.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. INTERFACE_SOURCES
  2. -----------------
  3. .. versionadded:: 4.4
  4. List of interface sources to compile into consuming targets.
  5. The :command:`target_sources` command sets or adds to the ``INTERFACE_SOURCES``
  6. file set property for the file sets defined with the ``PUBLIC`` or
  7. ``INTERFACE`` keyword and is the usual way to manipulate it.
  8. Contents of ``INTERFACE_SOURCES`` may use
  9. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  10. Each file must be in one of the base directories, or a subdirectory of one of
  11. the base directories.
  12. If relative paths are specified, they are considered relative to the target's
  13. source directory.
  14. The following behavior applies for the :prop_fs:`SOURCES` and
  15. ``INTERFACE_SOURCES`` file set properties, dependent on the value of the
  16. :prop_fs:`SCOPE` file set property:
  17. ``PRIVATE``
  18. Only the :prop_fs:`SOURCES` property can be set. Any change to the
  19. ``INTERFACE_SOURCES`` property will be ignored.
  20. ``PUBLIC``
  21. :prop_fs:`SOURCES` and ``INTERFACE_SOURCES`` properties will always have the
  22. same content.
  23. ``INTERFACE``
  24. Only the ``INTERFACE_SOURCES`` property can be set. Any change to the
  25. :prop_fs:`SOURCES` property will be ignored.