- 需要配置好项目的setting.json,添加vcpkg和cmake的tookchain
{
"files.associations": {
"iostream": "cpp",
"cstring": "cpp"
},
"cmake.sourceDirectory": "${workspaceFolder}/src",
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "/root/software/vcpkg/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "x64-linux"
}
}
- 使用vcpkg安装第三方包
- 按照vcpkg的提示,添加包到cmakelist文件