Help: Fix references to cmake_language(GET_MESSAGE_LOG_LEVEL)

While we're at it, use the new `:cmake-option:` role to shorten some
references to `--log-level`.
This commit is contained in:
Tyler Yankee
2026-06-04 09:03:55 -04:00
parent 02f124275c
commit ef5e1e3a5b
3 changed files with 9 additions and 14 deletions

View File

@@ -495,8 +495,6 @@ Getting current message log level
.. versionadded:: 3.25
.. _query_message_log_level:
.. signature::
cmake_language(GET_MESSAGE_LOG_LEVEL <output_variable>)
@@ -506,9 +504,8 @@ Getting current message log level
See :command:`message` for the possible logging levels.
The current message logging level can be set either using the
:option:`--log-level <cmake --log-level>`
command line option of the :manual:`cmake(1)` program or using
the :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable.
:cmake-option:`--log-level` command line option of the :manual:`cmake(1)`
program or using the :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable.
If both the command line option and the variable are set, the command line
option takes precedence. If neither are set, the default logging level

View File

@@ -426,8 +426,8 @@ Options
synonym for this option.
.. versionadded:: 3.25
See the :command:`cmake_language` command for a way to
:ref:`query the current message logging level <query_message_log_level>`.
See the :command:`cmake_language(GET_MESSAGE_LOG_LEVEL)` command for a way
to query the current message logging level.
.. option:: --log-context

View File

@@ -5,10 +5,9 @@ CMAKE_MESSAGE_LOG_LEVEL
When set, this variable specifies the logging level used by the
:command:`message` command. Valid values are the same as those for the
:option:`--log-level <cmake --log-level>` command line option of the
:manual:`cmake(1)` program. If this variable is set and the
:option:`--log-level <cmake --log-level>` command line option is
given, the command line option takes precedence.
:cmake-option:`--log-level` command line option of the :manual:`cmake(1)`
program. If this variable is set and the :cmake-option:`--log-level` command
line option is given, the command line option takes precedence.
The main advantage to using this variable is to make a log level persist
between CMake runs. Setting it as a cache variable will ensure that
@@ -18,6 +17,5 @@ Projects should not set this variable, it is intended for users so that
they may control the log level according to their own needs.
.. versionadded:: 3.25
See the :command:`cmake_language`
:ref:`cmake_language <query_message_log_level>` command for a way to query
the current message logging level.
See the :command:`cmake_language(GET_MESSAGE_LOG_LEVEL)` command for a way to
query the current message logging level.