I followed the tutorial of microsoft
I set the CMAKE_TOOLCHAIN_FILE of my local variable.
Yet it still hint that
"Add the installation prefix of xxx to CMAKE_PREFIX_PATH or set xxx_DIR"
And I set the CMAKE_PREFIX_PATH in CMakePresets.json:
{
"version": 2,
"configurePresets": [
{
"name": "default",
"generator": "Visual Studio 17 2022",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "<ROOT>/vcpkg/scripts/buildsystems/vcpkg.cmake",
"CMAKE_PREFIX_PATH": "<ROOT>/vcpkg/packages/jsoncpp_x64-windows/share/jsoncpp"
}
},
{
"name": "release",
"inherits": "default",
"description": "Release configuration",
"hidden": false,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "debug",
"inherits": "default",
"description": "Debug configuration",
"hidden": false,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
}
]
}
Now it compiled.
New contributor
Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.