################# cmake_test/colors ################# .. module:: cmake_test/colors This module provides an option called :code:`CMAKETEST_USE_COLORS` and a set of global variables to use to color terminal output. These global constants are just one-to-one constants of specific ANSI control codes. If :code:`CMAKETEST_USE_COLORS` is not set to true or if the OS is Windows (cmd doesn't support ANSI control codes), these constants will not be defined and should resolve to an empty string. Example: .. code:: cmake set(example "${CT_Red}This will be red if the option is set${CT_ColorReset}") .. data:: CMAKETEST_USE_COLORS .. note:: This variable is a user-editable option, meaning it appears within the cache and can be edited on the command line by the :code:`-D` flag. Enable colors in Unix environments, ignored on Windows. Will output garbage for pipes and text files. If false, all constants in this file are not defined, so will resolve to the empty string. :Help text: "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." :Default value: "FALSE" :type: bool .. function:: string(ASCII 27 Esc) .. warning:: This is a generic command invocation. It is not a function or macro definition. The character used to start the ANSI control code. .. data:: CT_ColorReset Resets the color to the terminal default. :Default value: ${Esc}[m :type: str .. data:: CT_ColorBold Sets the text that follows to be bold. :Default value: ${Esc}[1m :type: str .. data:: CT_Red Sets the text color to red. :Default value: ${Esc}[31m :type: str .. data:: CT_Green Sets the text color to green. :Default value: ${Esc}[32m :type: str .. data:: CT_Yellow Sets the text color to yellow. :Default value: ${Esc}[33m :type: str .. data:: CT_Blue Sets the text color to blue. :Default value: ${Esc}[34m :type: str .. data:: CT_Magenta Sets the text color to magenta. :Default value: ${Esc}[35m :type: str .. data:: CT_Cyan Sets the text color to cyan. :Default value: ${Esc}[36m :type: str .. data:: CT_White Sets the text color to white. :Default value: ${Esc}[37m :type: str .. data:: CT_BoldRed Sets the text color to bold red. :Default value: ${Esc}[1;31m :type: str .. data:: CT_BoldGreen Sets the text color to bold green. :Default value: ${Esc}[1;32m :type: str .. data:: CT_BoldYellow Sets the text color to bold yellow. :Default value: ${Esc}[1;33m :type: str .. data:: CT_BoldBlue Sets the text color to bold blue. :Default value: ${Esc}[1;34m :type: str .. data:: CT_BoldMagenta Sets the text color to bold magenta. :Default value: ${Esc}[1;35m :type: str .. data:: CT_BoldCyan Sets the text color to bold cyan. :Default value: ${Esc}[1;36m :type: str .. data:: CT_BoldWhite Sets the text color to bold white. :Default value: ${Esc}[1;37m :type: str