get_source_file_property.rst 929 B

12345678910111213141516171819202122
  1. get_source_file_property
  2. ------------------------
  3. Get a property for a source file.
  4. .. code-block:: cmake
  5. get_source_file_property(VAR file property)
  6. Gets a property from a source file. The value of the property is
  7. stored in the variable ``VAR``. If the source property is not found, the
  8. behavior depends on whether it has been defined to be an ``INHERITED`` property
  9. or not (see :command:`define_property`). Non-inherited properties will set
  10. ``VAR`` to "NOTFOUND", whereas inherited properties will search the relevant
  11. parent scope as described for the :command:`define_property` command and
  12. if still unable to find the property, ``VAR`` will be set to an empty string.
  13. Use :command:`set_source_files_properties` to set property values. Source
  14. file properties usually control how the file is built. One property that is
  15. always there is :prop_sf:`LOCATION`.
  16. See also the more general :command:`get_property` command.