From df0e50d756c4d4187a3b6fa20fc036669ea8c07c Mon Sep 17 00:00:00 2001
From: Martin Willers <M.Willers@gmx.net>
Date: Sun, 2 May 2021 22:12:51 +0200
Subject: CTest: Add env var CLICOLOR to disable color output

Based on the implementation in Terminal.c:kwsysTerminalStreamIsVT100.
---
 Source/cmCTest.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 79a3925..7534e37 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2215,6 +2215,10 @@ bool cmCTest::ColoredOutputSupportedByConsole()
       !clicolor_force.empty() && clicolor_force != "0") {
     return true;
   }
+  std::string clicolor;
+  if (cmSystemTools::GetEnv("CLICOLOR", clicolor) && clicolor == "0") {
+    return false;
+  }
   return ConsoleIsNotDumb();
 #endif
 }
-- 
cgit v0.12