Merge topic 'execute-process-error'

3ece058d97 execute_process: Allow setting default COMMAND_ERROR_IS_FATAL value
85035dd954 Help/command/execute_process: Fix definition list formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10169
This commit is contained in:
Brad King
2025-01-16 13:58:45 +00:00
committed by Kitware Robot
17 changed files with 130 additions and 13 deletions
+21 -6
View File
@@ -24,7 +24,7 @@ Execute one or more child processes.
[ENCODING <name>]
[ECHO_OUTPUT_VARIABLE]
[ECHO_ERROR_VARIABLE]
[COMMAND_ERROR_IS_FATAL <ANY|LAST>])
[COMMAND_ERROR_IS_FATAL <ANY|LAST|NONE>])
Runs the given sequence of one or more commands.
@@ -168,17 +168,32 @@ Options:
`UTF-8 RFC <https://datatracker.ietf.org/doc/html/rfc3629>`_
naming convention.
``COMMAND_ERROR_IS_FATAL <ANY|LAST>``
``COMMAND_ERROR_IS_FATAL <ANY|LAST|NONE>``
.. versionadded:: 3.19
The option following ``COMMAND_ERROR_IS_FATAL`` determines the behavior when
an error is encountered:
``ANY``
``ANY``
If any of the commands in the list of commands fail, the
``execute_process()`` command halts with an error.
``LAST``
``LAST``
If the last command in the list of commands fails, the
``execute_process()`` command halts with an error. Commands earlier in the
list will not cause a fatal error.
``execute_process()`` command halts with an error.
Commands earlier in the list will not cause a fatal error.
``NONE``
.. versionadded:: 3.32
Regardless of any of the commands failing, the ``execute_process()``
command will not halt with an error.
.. versionadded:: 3.32
If not provided, the
:variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL` variable
is checked. If the variable is not set, the default is ``NONE``.
If ``RESULT_VARIABLE`` or ``RESULTS_VARIABLE`` is supplied,
:variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL` is ignored.
+1
View File
@@ -199,6 +199,7 @@ Variables that Change Behavior
/variable/CMAKE_ERROR_DEPRECATED
/variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO
/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
/variable/CMAKE_EXPORT_BUILD_DATABASE
/variable/CMAKE_EXPORT_COMPILE_COMMANDS
/variable/CMAKE_EXPORT_PACKAGE_REGISTRY
@@ -0,0 +1,6 @@
execute-process-error
---------------------
* The :variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL` variable
was added to specify the :command:`execute_process` command's
default ``COMMAND_ERROR_IS_FATAL`` behavior.
@@ -0,0 +1,9 @@
CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
--------------------------------------------
.. versionadded:: 3.32
Specify a default for the :command:`execute_process` command's
``COMMAND_ERROR_IS_FATAL`` option. This variable is ignored when a
``RESULTS_VARIABLE`` or ``RESULT_VARIABLE`` keyword is supplied to
the command.