Reputation: 43
Short Version: vcpkg is failing to build a package with the following error:
Unable to determine appropriate CMake MSBuild generator for:
Windows-x64-v142
This is because CMake 3.12.4 does not currently have a 'Visual Studio 16
2019' option.
even though cmake 3.14 is installed. I'd like to tell it to use cmake 3.14
Long Version:
Background:
I'm experimenting with visual studio 2019 and vcpkg. I currently have visual studio 2017 and vcpkg working perfectly.
Setup:
I created a new triplet for the purpose of installing my 14.2 packages alongside my 14.1 packages. This triplet, which I named x64-windows-dynamic-2019-142, is exactly the same as the standard x64-windows triplet, but I added VCPKG_VISUAL_STUDIO_PATH and VCPKG_PLATFORM_TOOLSET to it. The full triplet file looks like:
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_VISUAL_STUDIO_PATH "C:\\Program Files (x86)\\Microsoft Visual
Studio\\2019\\Community")
set(VCPKG_PLATFORM_TOOLSET "v142")
I pulled vcpkg to be up to date with the newest master branch and re-ran bootstrap-vcpkg.bat.
Problem:
When I run vcpkg install sfml:x64-windows-dynamic-2019-142
It installs many of the dependencies of sfml without error, but fails to install sfml citing the error I mentioned above.
I am confused why the dependencies did not fail to build, but what I'd really like to know is how to get vcpkg to use my installed and up to date CMake so that it can finish the build.
When I run a 'cmake --version' in the same power shell that I'm installing sfml from It returns "cmake version 3.14.0"
Upvotes: 4
Views: 4608
Reputation: 65791
Try setting the environment variable VCPKG_FORCE_SYSTEM_BINARIES before invoking vcpkg.exe
, i.e.:
C:\vcpkg>set VCPKG_FORCE_SYSTEM_BINARIES=1
C:\vcpkg>vcpkg install sfml:x64-windows-dynamic-2019-142
Note that the tools cmake.exe
, git.exe
and ninja.exe
must be available on the path.
Upvotes: 2