mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-23 07:28:51 -06:00
cmake_language: Rename command from cmake_command
Also rename the `INVOKE` signature to `CALL`. Fixes: #20732
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
cmake_command
|
||||
-------------
|
||||
cmake_language
|
||||
--------------
|
||||
|
||||
Call meta-operations on CMake commands.
|
||||
|
||||
@@ -8,8 +8,8 @@ Synopsis
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
cmake_command(`INVOKE`_ <command> [<args>...])
|
||||
cmake_command(`EVAL`_ CODE <code>...)
|
||||
cmake_language(`CALL`_ <command> [<args>...])
|
||||
cmake_language(`EVAL`_ CODE <code>...)
|
||||
|
||||
Introduction
|
||||
^^^^^^^^^^^^
|
||||
@@ -17,24 +17,24 @@ Introduction
|
||||
This command will call meta-operations on built-in CMake commands or
|
||||
those created via the :command:`macro` or :command:`function` commands.
|
||||
|
||||
``cmake_command`` does not introduce a new variable or policy scope.
|
||||
``cmake_language`` does not introduce a new variable or policy scope.
|
||||
|
||||
Invoking Commands
|
||||
^^^^^^^^^^^^^^^^^
|
||||
Calling Commands
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. _INVOKE:
|
||||
.. _CALL:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
cmake_command(INVOKE <command> [<args>...])
|
||||
cmake_language(CALL <command> [<args>...])
|
||||
|
||||
Invokes the named ``<command>`` with the given arguments (if any).
|
||||
Calls 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!")
|
||||
cmake_language(CALL ${message_command} STATUS "Hello World!")
|
||||
|
||||
is equivalent to
|
||||
|
||||
@@ -49,7 +49,7 @@ Evaluating Code
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
cmake_command(EVAL CODE <code>...)
|
||||
cmake_language(EVAL CODE <code>...)
|
||||
|
||||
Evaluates the ``<code>...`` as CMake code.
|
||||
|
||||
@@ -62,7 +62,7 @@ For example, the code:
|
||||
set(C TRUE)
|
||||
set(condition "(A AND B) OR C")
|
||||
|
||||
cmake_command(EVAL CODE "
|
||||
cmake_language(EVAL CODE "
|
||||
if (${condition})
|
||||
message(STATUS TRUE)
|
||||
else()
|
||||
@@ -44,14 +44,14 @@ can be invoked through any of
|
||||
foo()
|
||||
Foo()
|
||||
FOO()
|
||||
cmake_command(INVOKE foo)
|
||||
cmake_language(CALL 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.
|
||||
The :command:`cmake_language(CALL ...)` command can also be used to
|
||||
invoke the function.
|
||||
|
||||
Arguments
|
||||
^^^^^^^^^
|
||||
|
||||
@@ -42,14 +42,14 @@ can be invoked through any of
|
||||
foo()
|
||||
Foo()
|
||||
FOO()
|
||||
cmake_command(INVOKE foo)
|
||||
cmake_language(CALL 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.
|
||||
The :command:`cmake_language(CALL ...)` command can also be used to
|
||||
invoke the macro.
|
||||
|
||||
Arguments
|
||||
^^^^^^^^^
|
||||
|
||||
Reference in New Issue
Block a user