Merge topic 'doc-get-properties-inherited'

8086badba4 Help: Fix wrong return values for unset inherited properties
1ca5ec67b0 Help: Add missing DIRECTORY keyword to set_tests_properties() signature
34379f005b Help: Use <variable> consistently in property getter commands
29ccc9a4cd Help: Use <xxx> for non-keyword arguments in property command signatures

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9131
This commit is contained in:
Brad King
2024-01-05 15:18:29 +00:00
committed by Kitware Robot
7 changed files with 32 additions and 34 deletions

View File

@@ -5,11 +5,11 @@ Get a global property of the CMake instance.
.. code-block:: cmake
get_cmake_property(<var> <property>)
get_cmake_property(<variable> <property>)
Gets a global property from the CMake instance. The value of
the ``<property>`` is stored in the variable ``<var>``.
If the property is not found, ``<var>`` will be set to ``NOTFOUND``.
the ``<property>`` is stored in the specified ``<variable>``.
If the property is not found, ``<variable>`` will be set to ``NOTFOUND``.
See the :manual:`cmake-properties(7)` manual for available properties.
In addition to global properties, this command (for historical reasons)

View File

@@ -9,14 +9,12 @@ Get a property for a source file.
[DIRECTORY <dir> | TARGET_DIRECTORY <target>]
<property>)
Gets a property from a source file. The value of the property is
stored in the specified ``<variable>``. If the source property is not found,
the behavior depends on whether it has been defined to be an ``INHERITED``
property or not (see :command:`define_property`). Non-inherited properties
will set ``variable`` to ``NOTFOUND``, whereas inherited properties will search
the relevant parent scope as described for the :command:`define_property`
command and if still unable to find the property, ``variable`` will be set to
an empty string.
Gets a property from a source file. The value of the property is stored in
the specified ``<variable>``. If the ``<file>`` is not a source file, or the
source property is not found, ``<variable>`` will be set to ``NOTFOUND``.
If the source property was defined to be an ``INHERITED`` property (see
:command:`define_property`), the search will include the relevant parent
scopes, as described for the :command:`define_property` command.
By default, the source file's property will be read from the current source
directory's scope.

View File

@@ -5,16 +5,14 @@ Get a property from a target.
.. code-block:: cmake
get_target_property(<VAR> target property)
get_target_property(<variable> <target> <property>)
Get a property from a target. The value of the property is stored in
the variable ``<VAR>``. If the target property is not found, the behavior
depends on whether it has been defined to be an ``INHERITED`` property
or not (see :command:`define_property`). Non-inherited properties will
set ``<VAR>`` to ``<VAR>-NOTFOUND``, whereas inherited properties will search
the relevant parent scope as described for the :command:`define_property`
command and if still unable to find the property, ``<VAR>`` will be set to
an empty string.
Get a property from a target. The value of the property is stored in the
specified ``<variable>``. If the target property is not found, ``<variable>``
will be set to ``<variable>-NOTFOUND``. If the target property was defined to
be an ``INHERITED`` property (see :command:`define_property`), the search will
include the relevant parent scopes, as described for the
:command:`define_property` command.
Use :command:`set_target_properties` to set target property values.
Properties are usually used to control how a target is built, but some

View File

@@ -5,16 +5,14 @@ Get a property of the test.
.. code-block:: cmake
get_test_property(test property [DIRECTORY <dir>] VAR)
get_test_property(<test> <property> [DIRECTORY <dir>] <variable>)
Get a property from the test. The value of the property is stored in
the variable ``VAR``. If the test property is not found, the behavior
depends on whether it has been defined to be an ``INHERITED`` property
or not (see :command:`define_property`). Non-inherited properties will
set ``VAR`` to "NOTFOUND", whereas inherited properties will search the
relevant parent scope as described for the :command:`define_property`
command and if still unable to find the property, ``VAR`` will be set to
an empty string.
the specified ``<variable>``. If the ``<test>`` is not defined, or the
test property is not found, ``<variable>`` will be set to ``NOTFOUND``.
If the test property was defined to be an ``INHERITED`` property (see
:command:`define_property`), the search will include the relevant parent
scopes, as described for the :command:`define_property` command.
For a list of standard properties you can type
:option:`cmake --help-property-list`.

View File

@@ -5,9 +5,10 @@ Set properties of the current directory and subdirectories.
.. code-block:: cmake
set_directory_properties(PROPERTIES prop1 value1 [prop2 value2] ...)
set_directory_properties(PROPERTIES <prop1> <value1> [<prop2> <value2>] ...)
Sets properties of the current directory and its subdirectories in key-value pairs.
Sets properties of the current directory and its subdirectories in key-value
pairs.
See also the :command:`set_property(DIRECTORY)` command.

View File

@@ -5,9 +5,9 @@ Targets can have properties that affect how they are built.
.. code-block:: cmake
set_target_properties(target1 target2 ...
PROPERTIES prop1 value1
prop2 value2 ...)
set_target_properties(<targets> ...
PROPERTIES <prop1> <value1>
[<prop2> <value2>] ...)
Sets properties on targets. The syntax for the command is to list all
the targets you want to change, and then provide the values you want to

View File

@@ -5,7 +5,10 @@ Set a property of the tests.
.. code-block:: cmake
set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)
set_tests_properties(<tests>...
[DIRECTORY <dir>]
PROPERTIES <prop1> <value1>
[<prop2> <value2>]...)
Sets a property for the tests. If the test is not found, CMake
will report an error.