get_directory_property.rst 1.0 KB

1234567891011121314151617181920212223242526272829
  1. get_directory_property
  2. ----------------------
  3. Get a property of ``DIRECTORY`` scope.
  4. .. code-block:: cmake
  5. get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>)
  6. Stores a property of directory scope in the named ``<variable>``.
  7. The ``DIRECTORY`` argument specifies another directory from which
  8. to retrieve the property value instead of the current directory.
  9. The specified directory must have already been traversed by CMake.
  10. If the property is not defined for the nominated directory scope,
  11. an empty string is returned. In the case of ``INHERITED`` properties,
  12. if the property is not found for the nominated directory scope,
  13. the search will chain to a parent scope as described for the
  14. :command:`define_property` command.
  15. .. code-block:: cmake
  16. get_directory_property(<variable> [DIRECTORY <dir>]
  17. DEFINITION <var-name>)
  18. Get a variable definition from a directory. This form is useful to
  19. get a variable definition from another directory.
  20. See also the more general :command:`get_property` command.