CMake在makefile中更改颜色 [英] CMake change color in makefile
问题描述
CMake生成的make文件具有彩色输出,以提高可读性.
The make files generated by CMake have a colorful output for improved readability.
是否可以更改颜色?我有一个绿色的终端字体,所以我有点松散了指示对象已建立的消息的颜色.
Is it possible to change the color? I have a green terminal font so I kind of loose the color for the messages indicating that objects are built.
推荐答案
CMake 3.18开始提供一个名为 CCMAKE_COLORS
的变量,用于更改输出颜色.引用文档:
CMake 3.18 started to provide a variable called CCMAKE_COLORS
that changes the output colors. Citing the documentation:
确定CMake curses界面[..]使用什么颜色.语法遵循与LS_COLORS相同的约定.那就是一个清单键/值对之间以:.
Determines what colors are used by the CMake curses interface [..]. The syntax follows the same conventions as LS_COLORS; that is, a list of key/value pairs separated by :.
[..]
例如:
CCMAKE_COLORS ='s = 39:p = 220:c = 207:n = 196:y = 46'
CCMAKE_COLORS='s=39:p=220:c=207:n=196:y=46'
使用 s
一个字符串,使用 p
一个文件路径,依此类推.来源: https://cmake.org/cmake/help/latest/envvar/CCMAKE_COLORS.html
With s
a string, p
a file path and so on. Source: https://cmake.org/cmake/help/latest/envvar/CCMAKE_COLORS.html
这篇关于CMake在makefile中更改颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!