Replies: 1 comment 11 replies
-
Is your project configuration x64? |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have installed VCPKG to "C:\Tools\VCPKG" and have defined the following environment variables:
Using Visual Studio Community, I would like to use VCPKG in manifest mode together with CMake, and have added a simple "vcpkg.json" to my project directory:
I also have a "CMakePresets.json" filer, where I have added:
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
to the "cacheVariables" section.
In my "CMakeLists.txt" file I have added the following:
When CMake generates, it appears to correctly install Python3 version 3.7.3:
However, when CMake tries to find Python3, it finds the wrong package:
I have no path-entries referring to the Python 3.11.1 installation, but nevertheless this is what CMake finds instead of the just installed VCPKG Python 3.7.3.
If I choose to remove the "vcpkg.json" file and delete the "out" folder, and hence switch to classic mode, and here install Python3:
version 3.10.7 will be installed, and if I now generate CMake this package is found:
(NOTE: if "Interpreter" is not included in the "find_package" line, it will NOT correctly find "Developmet")
The question now is: why does it NOT find the package in "manifest mode" when it can find it in "classical mode"? Am I doing something wrong or have forgotten something?
If I create a new "identical" project, where I use the normal MSBuild-system instead of CMake, "manifest mode" works as expected and builds my project with Python3 v. 3.7.3 as instructed.
Beta Was this translation helpful? Give feedback.
All reactions