编译一个项目报错如下:
CMake Error at Rx/v2/test/CMakeLists.txt:125 (target_compile_features):
target_compile_features no known features for CXX compiler
""
version .
经过调查,可能是由于 target_compile_features 功能的当前版本支持的不完善导致的。已经使用的是cmake 3.14.2了,难道还不够新吗? 为了验证一下,从 https://codeload.github.com/jschueller/cmake-target_compile_features/zip/master 下载了一个测试项目,编译依然报同样的错误。
到cmake主页Download CMake查看,cmake最新版本已经到了3.15.3了,
抱着试试看的态度,下载了3.15.3版本,将3.14.2版本替换掉。再次编译从https://codeload.github.com/jschueller/cmake-target_compile_features/zip/master下载的项目,编译成功。