summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-27 15:21:09 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-02-27 15:21:21 (GMT)
commitc58b9c5ab94d674c76a17e6154f05e0e8c5c37d1 (patch)
tree0f7c58ab4cb216c9e29308aeab4cb5251e397e2c /Help
parentd6fa2311275ce3c6f0e42989e523158952fc1449 (diff)
parent54e4f2ad455817bed165fa1cb3682acbd93a8a1a (diff)
downloadCMake-c58b9c5ab94d674c76a17e6154f05e0e8c5c37d1.zip
CMake-c58b9c5ab94d674c76a17e6154f05e0e8c5c37d1.tar.gz
CMake-c58b9c5ab94d674c76a17e6154f05e0e8c5c37d1.tar.bz2
Merge topic 'cmake_command-command'
54e4f2ad45 cmake_command: Add command to INVOKE other commands by name Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kyle Edwards <kyle.edwards@kitware.com> Merge-request: !4286
Diffstat (limited to 'Help')
-rw-r--r--Help/command/cmake_command.rst40
-rw-r--r--Help/command/function.rst4
-rw-r--r--Help/command/macro.rst4
-rw-r--r--Help/manual/cmake-commands.7.rst1
-rw-r--r--Help/release/dev/cmake_command-command.rst6
5 files changed, 55 insertions, 0 deletions
diff --git a/Help/command/cmake_command.rst b/Help/command/cmake_command.rst
new file mode 100644
index 0000000..9281647
--- /dev/null
+++ b/Help/command/cmake_command.rst
@@ -0,0 +1,40 @@
+cmake_command
+-------------
+
+Call meta-operations on CMake commands.
+
+Synopsis
+^^^^^^^^
+
+.. parsed-literal::
+
+ cmake_command(`INVOKE`_ <command> [<args>...])
+
+Introduction
+^^^^^^^^^^^^
+
+This command will call meta-operations on built-in CMake commands or
+those created via the :command:`macro` or :command:`function` commands.
+
+Invoking
+^^^^^^^^
+
+.. _INVOKE:
+
+.. code-block:: cmake
+
+ cmake_command(INVOKE <command> [<args>...])
+
+Invokes the named ``<command>`` with the given arguments (if any).
+For example, the code:
+
+.. code-block:: cmake
+
+ set(message_command "message")
+ cmake_command(INVOKE ${message_command} STATUS "Hello World!")
+
+is equivalent to
+
+.. code-block:: cmake
+
+ message(STATUS "Hello World!")
diff --git a/Help/command/function.rst b/Help/command/function.rst
index 53ba754..30938b3 100644
--- a/Help/command/function.rst
+++ b/Help/command/function.rst
@@ -44,11 +44,15 @@ can be invoked through any of
foo()
Foo()
FOO()
+ cmake_command(INVOKE foo)
and so on. However, it is strongly recommended to stay with the
case chosen in the function definition. Typically functions use
all-lowercase names.
+The :command:`cmake_command(INVOKE ...)` command can also be used to invoke the
+function.
+
Arguments
^^^^^^^^^
diff --git a/Help/command/macro.rst b/Help/command/macro.rst
index 3f6f2f9..ee955cb 100644
--- a/Help/command/macro.rst
+++ b/Help/command/macro.rst
@@ -42,11 +42,15 @@ can be invoked through any of
foo()
Foo()
FOO()
+ cmake_command(INVOKE foo)
and so on. However, it is strongly recommended to stay with the
case chosen in the macro definition. Typically macros use
all-lowercase names.
+The :command:`cmake_command(INVOKE ...)` command can also be used to invoke the
+macro.
+
Arguments
^^^^^^^^^
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 59ba897..87743b4 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -16,6 +16,7 @@ These commands are always available.
:maxdepth: 1
/command/break
+ /command/cmake_command
/command/cmake_host_system_information
/command/cmake_minimum_required
/command/cmake_parse_arguments
diff --git a/Help/release/dev/cmake_command-command.rst b/Help/release/dev/cmake_command-command.rst
new file mode 100644
index 0000000..ebe75b1
--- /dev/null
+++ b/Help/release/dev/cmake_command-command.rst
@@ -0,0 +1,6 @@
+cmake_command
+-------------
+
+* The :command:`cmake_command()` command was added for meta-operations on
+ scripted or built-in commands, starting with a mode to ``INVOKE`` other
+ commands.