From 29ccc9a4cd2d22553ab387d30c6eada15f25fb3e Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Fri, 5 Jan 2024 15:31:39 +1100 Subject: Help: Use for non-keyword arguments in property command signatures --- Help/command/get_target_property.rst | 2 +- Help/command/get_test_property.rst | 10 +++++----- Help/command/set_directory_properties.rst | 5 +++-- Help/command/set_target_properties.rst | 6 +++--- Help/command/set_tests_properties.rst | 4 +++- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Help/command/get_target_property.rst b/Help/command/get_target_property.rst index 8c6dcb1..20027ee 100644 --- a/Help/command/get_target_property.rst +++ b/Help/command/get_target_property.rst @@ -5,7 +5,7 @@ Get a property from a target. .. code-block:: cmake - get_target_property( target property) + get_target_property( ) Get a property from a target. The value of the property is stored in the variable ````. If the target property is not found, the behavior diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst index 1fcf24e..08ddd4e 100644 --- a/Help/command/get_test_property.rst +++ b/Help/command/get_test_property.rst @@ -5,15 +5,15 @@ Get a property of the test. .. code-block:: cmake - get_test_property(test property [DIRECTORY ] VAR) + get_test_property( [DIRECTORY ] ) 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 +the variable ````. 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 +or not (see :command:`define_property`). Non-inherited properties will set +```` 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 +command and if still unable to find the property, ```` will be set to an empty string. For a list of standard properties you can type diff --git a/Help/command/set_directory_properties.rst b/Help/command/set_directory_properties.rst index 93ad39b..6d94808 100644 --- a/Help/command/set_directory_properties.rst +++ b/Help/command/set_directory_properties.rst @@ -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 [ ] ...) -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. diff --git a/Help/command/set_target_properties.rst b/Help/command/set_target_properties.rst index 874788b..5357575 100644 --- a/Help/command/set_target_properties.rst +++ b/Help/command/set_target_properties.rst @@ -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( ... + PROPERTIES + [ ] ...) 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 diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index da750e3..8eac0e2 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -5,7 +5,9 @@ Set a property of the tests. .. code-block:: cmake - set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2) + set_tests_properties(... + PROPERTIES + [ ]...) Sets a property for the tests. If the test is not found, CMake will report an error. -- cgit v0.12 From 34379f005b3ebab952113ce641ac666b85d7840a Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Fri, 5 Jan 2024 15:37:39 +1100 Subject: Help: Use consistently in property getter commands Property-related commands used a mix of , , or to specify the variable to store the result in. The form is particularly confusing, since being uppercase it looks more like a keyword. Use consistently across all the commands so that the behavior is clear. --- Help/command/get_cmake_property.rst | 6 +++--- Help/command/get_target_property.rst | 14 +++++++------- Help/command/get_test_property.rst | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Help/command/get_cmake_property.rst b/Help/command/get_cmake_property.rst index b1d18a0..9f78a86 100644 --- a/Help/command/get_cmake_property.rst +++ b/Help/command/get_cmake_property.rst @@ -5,11 +5,11 @@ Get a global property of the CMake instance. .. code-block:: cmake - get_cmake_property( ) + get_cmake_property( ) Gets a global property from the CMake instance. The value of -the ```` is stored in the variable ````. -If the property is not found, ```` will be set to ``NOTFOUND``. +the ```` is stored in the specified ````. +If the property is not found, ```` 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) diff --git a/Help/command/get_target_property.rst b/Help/command/get_target_property.rst index 20027ee..f4135cf 100644 --- a/Help/command/get_target_property.rst +++ b/Help/command/get_target_property.rst @@ -5,15 +5,15 @@ Get a property from a target. .. code-block:: cmake - get_target_property( ) + get_target_property( ) -Get a property from a target. The value of the property is stored in -the variable ````. If the target property is not found, the behavior +Get a property from a target. The value of the property is stored in the +specified ````. 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 ```` 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, ```` will be set to +or not (see :command:`define_property`). Non-inherited properties will set +```` 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, ```` will be set to an empty string. Use :command:`set_target_properties` to set target property values. diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst index 08ddd4e..866894d 100644 --- a/Help/command/get_test_property.rst +++ b/Help/command/get_test_property.rst @@ -5,15 +5,15 @@ Get a property of the test. .. code-block:: cmake - get_test_property( [DIRECTORY ] ) + get_test_property( [DIRECTORY ] ) Get a property from the test. The value of the property is stored in -the variable ````. If the test property is not found, the behavior +the specified ````. 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 -```` to ``NOTFOUND``, whereas inherited properties will search the +```` 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, ```` will be set to +command and if still unable to find the property, ```` will be set to an empty string. For a list of standard properties you can type -- cgit v0.12 From 1ca5ec67b048c29b86eb96e2097b4886ce045b7a Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Fri, 5 Jan 2024 16:45:27 +1100 Subject: Help: Add missing DIRECTORY keyword to set_tests_properties() signature --- Help/command/set_tests_properties.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index 8eac0e2..a21f746 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -6,6 +6,7 @@ Set a property of the tests. .. code-block:: cmake set_tests_properties(... + [DIRECTORY ] PROPERTIES [ ]...) -- cgit v0.12 From 8086badba452829beb7d87499f212edf9e51b7af Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Fri, 5 Jan 2024 17:33:07 +1100 Subject: Help: Fix wrong return values for unset inherited properties Since ff6234509e (Help: Clarify behavior of INHERITED properties, 2018-03-21), the docs for some get_..._property() commands incorrectly describe the behavior for inherited properties. When a property is not set, even in a parent scope, the returned result from the get_..._property() command is the same whether the property is inherited or not. The docs incorrectly stated that an empty string would be returned for inherited properties in such cases. --- Help/command/get_source_file_property.rst | 14 ++++++-------- Help/command/get_target_property.rst | 12 +++++------- Help/command/get_test_property.rst | 12 +++++------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst index e83e9c2..a7e5191 100644 --- a/Help/command/get_source_file_property.rst +++ b/Help/command/get_source_file_property.rst @@ -9,14 +9,12 @@ Get a property for a source file. [DIRECTORY | TARGET_DIRECTORY ] ) -Gets a property from a source file. The value of the property is -stored in the specified ````. 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 ````. If the ```` is not a source file, or the +source property is not found, ```` 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. diff --git a/Help/command/get_target_property.rst b/Help/command/get_target_property.rst index f4135cf..1554a85 100644 --- a/Help/command/get_target_property.rst +++ b/Help/command/get_target_property.rst @@ -8,13 +8,11 @@ Get a property from a target. get_target_property( ) Get a property from a target. The value of the property is stored in the -specified ````. 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 -```` 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, ```` will be set to -an empty string. +specified ````. If the target property is not found, ```` +will be set to ``-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 diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst index 866894d..3f1a64c 100644 --- a/Help/command/get_test_property.rst +++ b/Help/command/get_test_property.rst @@ -8,13 +8,11 @@ Get a property of the test. get_test_property( [DIRECTORY ] ) Get a property from the test. The value of the property is stored in -the specified ````. 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 -```` 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, ```` will be set to -an empty string. +the specified ````. If the ```` is not defined, or the +test property is not found, ```` 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`. -- cgit v0.12