CMAKE_COLOR_DIAGNOSTICS.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. CMAKE_COLOR_DIAGNOSTICS
  2. -----------------------
  3. .. versionadded:: 3.24
  4. Enable color diagnostics throughout the generated build system.
  5. This variable uses three states: ``ON``, ``OFF`` and not defined.
  6. When not defined:
  7. * :ref:`Makefile Generators` initialize the :variable:`CMAKE_COLOR_MAKEFILE`
  8. variable to ``ON``. It controls color buildsystem messages.
  9. * GNU/Clang compilers are not invoked with any color diagnostics flag.
  10. When ``ON``:
  11. * :ref:`Makefile Generators` produce color buildsystem messages by default.
  12. :variable:`CMAKE_COLOR_MAKEFILE` is not initialized, but may be
  13. explicitly set to ``OFF`` to disable color buildsystem messages.
  14. * GNU/Clang compilers are invoked with a flag enabling color diagnostics
  15. (``-fcolor-diagnostics``).
  16. When ``OFF``:
  17. * :ref:`Makefile Generators` do not produce color buildsystem messages by
  18. default. :variable:`CMAKE_COLOR_MAKEFILE` is not initialized, but may be
  19. explicitly set to ``ON`` to enable color buildsystem messages.
  20. * GNU/Clang compilers are invoked with a flag disabling color diagnostics
  21. (``-fno-color-diagnostics``).
  22. If the :envvar:`CMAKE_COLOR_DIAGNOSTICS` environment variable is set, its
  23. value is used. Otherwise, ``CMAKE_COLOR_DIAGNOSTICS`` is not defined by
  24. default.
  25. See the :envvar:`CLICOLOR` and :envvar:`CLICOLOR_FORCE` environment
  26. variables to control color output from CMake command-line tools.