include_guard()

#Enable colors in Unix environments, ignored on Windows. Will output garbage for pipes and text files
option(CMAKETEST_USE_COLORS "This option enables coloration in CMakeTest output. If enabled will mangle log files or pipes that do not support coloration. This option is ignored on Windows." "FALSE")

if(NOT WIN32 AND CMAKETEST_USE_COLORS)
  string(ASCII 27 Esc)
  set(CT_ColorReset "${Esc}[m")
  set(CT_ColorBold  "${Esc}[1m")
  set(CT_Red         "${Esc}[31m")
  set(CT_Green       "${Esc}[32m")
  set(CT_Yellow      "${Esc}[33m")
  set(CT_Blue        "${Esc}[34m")
  set(CT_Magenta     "${Esc}[35m")
  set(CT_Cyan        "${Esc}[36m")
  set(CT_White       "${Esc}[37m")
  set(CT_BoldRed     "${Esc}[1;31m")
  set(CT_BoldGreen   "${Esc}[1;32m")
  set(CT_BoldYellow  "${Esc}[1;33m")
  set(CT_BoldBlue    "${Esc}[1;34m")
  set(CT_BoldMagenta "${Esc}[1;35m")
  set(CT_BoldCyan    "${Esc}[1;36m")
  set(CT_BoldWhite   "${Esc}[1;37m")
endif()
