[CMake] [Patch] Colored output for make
Brad King
brad.king at kitware.com
Mon Jun 5 11:23:24 EDT 2006
Bertrand Jacquin wrote:
> On 6/3/06, Thomas Zander <zander at kde.org> wrote:
>
>> I noticed how sometimes I got colored output and other times I did not
>> when typing make.
>> I just discovered that cmake uses a string compare to the term name to
>> figure out which support color. I don't think thats the correct way, but
>> ok.
There are several tests. First it detects whether stdout is attached to
a windows console (Windows only of course). If so, it uses console text
attributes to do color. If not, then it detects whether it is attached
to an interactive terminal using the "isatty" function. If so, it
determines whether the terminal supports color by looking at the TERM
environment variable. This approach never prints color escapes when
they are not supported, but may not always print color when it is supported.
> Maybe rxvt-unicode could be added so ?
We've now added "screen", "cygwin", and "rxvt-unicode".
-Brad
More information about the CMake
mailing list