summaryrefslogtreecommitdiff
path: root/Modules/CMakeGenericSystem.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-09 17:15:45 +0000
committerKitware Robot <kwrobot@kitware.com>2022-03-09 12:15:53 -0500
commit51e81d1f7354fc425b3fc210900cab37ca00926f (patch)
treefbd06710a3ba6dc94af59103e834846cf8670229 /Modules/CMakeGenericSystem.cmake
parent4802b27e64db507a36c73cdabd7fd2ef01fda228 (diff)
parent6ab9fbd43bfce25cf9ee71a81145a1e5f9dc4a12 (diff)
downloadcmake-51e81d1f7354fc425b3fc210900cab37ca00926f.tar.gz
Merge topic 'color-diagnostics'
6ab9fbd43b color: Add tests for CMAKE_COLOR_DIAGNOSTICS 78adb1b952 color: Add CMAKE_COLOR_DIAGNOSTICS environment variable 884d9de8b7 color: Introduce CMAKE_COLOR_DIAGNOSTICS variable Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Frank Dana <ferdnyc@gmail.com> Merge-request: !6990
Diffstat (limited to 'Modules/CMakeGenericSystem.cmake')
-rw-r--r--Modules/CMakeGenericSystem.cmake11
1 files changed, 8 insertions, 3 deletions
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 6e75facff3..e2925dc98e 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -47,11 +47,16 @@ set (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
+if(DEFINED ENV{CMAKE_COLOR_DIAGNOSTICS} AND NOT DEFINED CACHE{CMAKE_COLOR_DIAGNOSTICS})
+ set(CMAKE_COLOR_DIAGNOSTICS $ENV{CMAKE_COLOR_DIAGNOSTICS} CACHE BOOL "Enable colored diagnostics throughout.")
+endif()
+
if(CMAKE_GENERATOR MATCHES "Make")
- set(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
- "Enable/Disable color output during build."
- )
+ if(NOT DEFINED CMAKE_COLOR_DIAGNOSTICS)
+ set(CMAKE_COLOR_MAKEFILE ON CACHE BOOL "Enable/Disable color output during build.")
+ endif()
mark_as_advanced(CMAKE_COLOR_MAKEFILE)
+
if(DEFINED CMAKE_RULE_MESSAGES)
set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
endif()