在cmake生成Xcode项目时报错“No CMAKE_C_COMPILER could be found”
原因是在命令行中xcode-select指向的是/Library/Developer/CommandLineTools,生成xcode项目时,需要将xcode-select指向/Applications/Xcode.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
如果设置xcode-select之后仍旧报错“No CMAKE_C_COMPILER could be found”, 解决方案是:
cmake ../ -GXcode -DCMAKE_C_COMPILER="$(xcrun -find cc)" -DCMAKE_CXX_COMPILER=