CTest: Add env var CLICOLOR to disable color output

Based on the implementation in Terminal.c:kwsysTerminalStreamIsVT100.
This commit is contained in:
Martin Willers
2021-05-02 22:12:51 +02:00
committed by Brad King
parent e0b4a22ca6
commit df0e50d756

View File

@@ -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
}