2014-08-03 19:52:23 +02:00
|
|
|
get_directory_property
|
|
|
|
----------------------
|
|
|
|
|
2015-11-17 17:22:37 +01:00
|
|
|
Get a property of ``DIRECTORY`` scope.
|
2014-08-03 19:52:23 +02:00
|
|
|
|
2019-11-11 23:01:05 +01:00
|
|
|
.. code-block:: cmake
|
2014-08-03 19:52:23 +02:00
|
|
|
|
|
|
|
get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>)
|
|
|
|
|
2019-11-11 23:01:05 +01:00
|
|
|
Stores a property of directory scope in the named ``<variable>``.
|
2021-09-14 00:13:48 +02:00
|
|
|
|
2018-08-09 18:06:22 +02:00
|
|
|
The ``DIRECTORY`` argument specifies another directory from which
|
|
|
|
to retrieve the property value instead of the current directory.
|
2021-09-14 00:13:48 +02:00
|
|
|
Relative paths are treated as relative to the
|
|
|
|
current source directory. CMake must already know about the directory,
|
|
|
|
either by having added it through a call to :command:`add_subdirectory`
|
|
|
|
or being the top level directory.
|
|
|
|
|
|
|
|
.. versionadded:: 3.19
|
|
|
|
``<dir>`` may reference a binary directory.
|
2018-08-09 18:06:22 +02:00
|
|
|
|
|
|
|
If the property is not defined for the nominated directory scope,
|
|
|
|
an empty string is returned. In the case of ``INHERITED`` properties,
|
|
|
|
if the property is not found for the nominated directory scope,
|
|
|
|
the search will chain to a parent scope as described for the
|
|
|
|
:command:`define_property` command.
|
2014-08-03 19:52:23 +02:00
|
|
|
|
2019-11-11 23:01:05 +01:00
|
|
|
.. code-block:: cmake
|
2014-08-03 19:52:23 +02:00
|
|
|
|
|
|
|
get_directory_property(<variable> [DIRECTORY <dir>]
|
|
|
|
DEFINITION <var-name>)
|
|
|
|
|
|
|
|
Get a variable definition from a directory. This form is useful to
|
|
|
|
get a variable definition from another directory.
|
|
|
|
|
2023-05-23 16:38:00 +02:00
|
|
|
|
|
|
|
See Also
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
* :command:`define_property`
|
|
|
|
* the more general :command:`get_property` command
|