1

I am trying to integrate vcpkg into an existing CMake Project using Visual Studio 2022. I have tried to follow online resources on the installation and setup process. Following this Microsoft document on CMake projects, I added the CMAKE_TOOLCHAIN_FILE variable to cacheVariables in my CMakePresets.json. They recommend using the VCPKG_ROOT environment variable to reach the vcpkg.cmake file, as in $env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake. However, when I try to generate the CMake cache, Cmake throws an error stating Could not find toolchain file: /scripts/buildsystems/vcpkg.cmake. This leads me to believe that the environment variable is not being set somehow. I have ran the bootstrap batch file and the command vckpg integrate install so I am at a loss for what is causing the problem.

Saereon
  • 229
  • 1
  • 2
  • 8
  • 2
    The document says environment variable for VCPKG_ROOT must be set. It seems you missed setting env. variable. Don't forget that you should restart VS2022 after setting it. – John Park Aug 21 '22 at 04:19

0 Answers0