message: Allow choosing output stream (stdout vs stderr) regardless of mode / level
When using cmake's script mode (-P
) as a general scripting language, it would be useful to choose which output stream (stderr
or stdout
) messages should be printed to, regardless of message level (STATUS
, NOTICE
, etc.)
If one wishes to print to stdout
, they are forced to choose between STATUS
to TRACE
, but those also get the --
prefix, which might be undesirable.
message(NOTICE)
doesn't print the --
prefix, but it goes to stderr
instead.
Perhaps we can have a new signature, something like:
message(PRINT "message text" ... ECHO [stdout | stderr])
with a default to stdout.
Edited by alcroito