On this page
CMAKE_COLOR_DIAGNOSTICS
New in version 3.24.
Enable color diagnostics throughout.
This variable uses three states: ON, OFF and not defined.
When not defined:
- Makefile Generators initialize the 
CMAKE_COLOR_MAKEFILEvariable toON. It controls color buildsystem messages. - GNU/Clang compilers are not invoked with any color diagnostics flag.
 
When ON:
- Makefile Generators produce color buildsystem messages by default. 
CMAKE_COLOR_MAKEFILEis not initialized, but may be explicitly set toOFFto disable color buildsystem messages. - GNU/Clang compilers are invoked with a flag enabling color diagnostics (
-fcolor-diagnostics). 
When OFF:
- Makefile Generators do not produce color buildsystem messages by default. 
CMAKE_COLOR_MAKEFILEis not initialized, but may be explicitly set toONto enable color buildsystem messages. - GNU/Clang compilers are invoked with a flag disabling color diagnostics (
-fno-color-diagnostics). 
If the CMAKE_COLOR_DIAGNOSTICS environment variable is set, its value is used. Otherwise, CMAKE_COLOR_DIAGNOSTICS is not defined by default.
© 2000–2022 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
 https://cmake.org/cmake/help/v3.25/variable/CMAKE_COLOR_DIAGNOSTICS.html