mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
Merge topic 'feature/message-indent'
5f6fd917a3 message(): Control indentation via CMAKE_MESSAGE_INDENT
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3464
This commit is contained in:
30
Help/variable/CMAKE_MESSAGE_INDENT.rst
Normal file
30
Help/variable/CMAKE_MESSAGE_INDENT.rst
Normal file
@@ -0,0 +1,30 @@
|
||||
CMAKE_MESSAGE_INDENT
|
||||
--------------------
|
||||
|
||||
The :command:`message` command joins the strings from this list and for
|
||||
log levels of ``NOTICE`` and below, it prepends the resultant string to
|
||||
each line of the message.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
list(APPEND listVar one two three)
|
||||
|
||||
message(VERBOSE [[Collected items in the "listVar":]])
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
|
||||
foreach(item IN LISTS listVar)
|
||||
message(VERBOSE ${item})
|
||||
endforeach()
|
||||
|
||||
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
||||
message(VERBOSE "No more indent")
|
||||
|
||||
Which results in the following output:
|
||||
|
||||
-- Collected items in the "listVar":
|
||||
-- one
|
||||
-- two
|
||||
-- tree
|
||||
-- No more indent
|
||||
Reference in New Issue
Block a user