首先安装ccache:
sudo apt install ccache
然后在cmake文件中添加如下代码即可:
find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif(CCACHE_FOUND)标签:set,GLOBAL,c++,编译,RULE,ccache,FOUND,CCACHE From: https://www.cnblogs.com/tiandsp/p/17519555.html