CMAKE_MESSAGE_INDENT¶
3.16 版新增。
该 message()
命令会连接此列表中的字符串,并且对于 NOTICE
及更低级别的日志,它会将生成的字符串添加到消息的每一行的前面。
示例
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")
这会导致以下输出
-- Collected items in the "listVar":
-- one
-- two
-- three
-- No more indent