使用 cmake 时,如果出现编译错误,则会输出包含错误文件的完整路径的错误。这条路径可能很长(参见下面的示例),因此它经常会自动换行并使其难以阅读。
示例输出:
/home/nick/projects/projectA/src/environment/base/terrain/base/TestFile.h:21:37: error: ‘TestFile’ does not name a type
/home/nick/projects/projectA/src/environment/base/terrain/base/TestFile.h:21:54: error: expected unqualified-id before ‘test’
/home/nick/projects/projectA/src/environment/base/terrain/base/TestFile.h:21:54: error: expected ‘)’ before ‘test’
有没有办法从错误中删除路径?像这样的东西:
TestFile.h:21:37: error: ‘TestFile’ does not name a type
TestFile.h:21:54: error: expected unqualified-id before ‘test’
TestFile.h:21:54: error: expected ‘)’ before ‘test’
谢谢