直接打开本地文件夹对应的Cmake工程
当第一次打开管理配置时,会在工程目录下生成一个 CMakeSettings.json文件
在解决方案资源管理器中-》右键-》打开方式-》弹出的窗口中选择使用Json编辑器
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
},
{
"name": "Visual Studio 9 2008 x86-Debug",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-G \"Visual Studio 9 2008\"",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x86" ]
}
]
}
以上以VS2008做示例,注意我的电脑上是安装了Vs20208了。
如果要使用其它工具平台集的话首先要在电脑安装好对应的平台工具集,
最好是整个IDE完全安装,
如何查看你的电脑是否支持其它编译平台工具集?
命令行“cmake --help"
其中会显示出所有你电脑支持的工具集,
命令行cmake要生效先要安装CMake工具,并把CMake的路径加入到系统环境变量 PATH中。
否则就是找不到 cmake命令了。