SOURCES.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. SOURCES
  2. -------
  3. .. versionadded:: 4.4
  4. This specifies the list of paths to sources for the file set.
  5. The :command:`target_sources` command sets or adds to the ``SOURCES`` file set
  6. property for the file sets defined with the ``PRIVATE`` or ``PUBLIC`` keyword
  7. and is the usual way to manipulate it.
  8. Contents of ``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. If relative paths are specified, they are considered
  12. relative to the target's source directory.
  13. The following behavior applies for the ``SOURCES`` and
  14. :prop_fs:`INTERFACE_SOURCES` file set properties, dependent on the value of the
  15. :prop_fs:`SCOPE` file set property:
  16. ``PRIVATE``
  17. Only the ``SOURCES`` property can be set. Any change to
  18. the :prop_fs:`INTERFACE_SOURCES` property will be ignored.
  19. ``PUBLIC``
  20. ``SOURCES`` and :prop_fs:`INTERFACE_SOURCES` properties will always have the
  21. same content.
  22. ``INTERFACE``
  23. Only the :prop_fs:`INTERFACE_SOURCES` property can be set. Any change to
  24. ``SOURCES`` property will be ignored.