Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print without newline in CMake?

Tags:

cmake

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;

like image 975
jpo38 Avatar asked Mar 06 '23 22:03

jpo38


1 Answers

You can use CMake's command mode to print without newline:

execute_process(COMMAND ${CMAKE_COMMAND} -E echo_append "Adding library...")
...
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "Done")
like image 152
sakra Avatar answered Mar 08 '23 10:03

sakra