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