CMAKE_MESSAGE_INDENT

From Get docs
Cmake/docs/3.21/variable/cmake message indent


CMAKE_MESSAGE_INDENT

New in version 3.16.


The 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:

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
--   three
-- No more indent

© 2000–2021 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.21/variable/CMAKE_MESSAGE_INDENT.html