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