4

It's all in the title. The message documentation does not propose any option to do so, but is there really no way to write some text using CMake without having it silently add a newline?

The idea is to print something like "Adding library...", and later print "Done" but keeping both messages on the same line;

4

1 回答 1

7

您可以使用 CMake 的命令模式在没有换行符的情况下进行打印:

execute_process(COMMAND ${CMAKE_COMMAND} -E echo_append "Adding library...")
...
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "Done")
于 2018-06-26T15:07:28.543 回答