根据标题,CMake无法找到我使用微软的vcpkg工具通过CMake的find_package()宏安装的SFML。
我已验证是否已在vcpkg安装目录(~\vcpkg\installed\x86-windows)中安装了SFML。
此外,我还在CMakeSettings.json文件中包含了来自vcpkg的工具链文件。
具体的错误是:
CMake Error at ~\CMakeLists.txt:40 (find_package):
Could not find a package configuration file provided by "SFML" (request
我使用vcpkg加载C++项目的C++。
对于vcpkg,
我想我把它整合得很正确:
PS D:\tool\vcpkg\vcpkg> .\vcpkg.exe integrate install
Applied user-wide integration for this vcpkg root.
All MSBuild C++ projects can now #include any installed libraries.
Linking will be handled automatically.
Installing new libraries will make them in
短版本: vcpkg无法构建包含以下错误的包:
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.
即使安装了cmake 3.14。我想告诉它使用cmake 3.14
长版本:
背景:
我正在试验视频工作室2019和vcpkg。目前,我有视频工作室2017和vcpkg完美地工作。
设置:
我创
我想要创建一个项目使用VSCode+CMake+VCPKG(VTK+Qt5),我仍然想与队友分享我的VCPKG依赖。所以我出口VCPKG。
当我尝试find_package(Qt5 COMPONENTS Core REQUIRED)时,问题发生了
By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5", but
CMake did not
我正在尝试导出我一直使用命令开发的引擎的所有依赖目标。依赖项的所有操作都很好,但是当我用main "Nabla“目标调用命令时,我会得到以下错误:
CMake Error in CMakeLists.txt:
export called with target "Nabla" which requires target "openssl_build"
that is not in any export set.
问题是,openssl_build是一个自定义的目标,我不知道如何避免这个错误,因为当我试图导出目标时,我会得到另一个错误,告诉我
--
我已经安装了vcpkg和opencv,使用vcpkg尝试导入c++中的opencv库,我一直收到以下错误:
main.cpp:2:10: fatal error: opencv2/opencv.hpp: No such file or directory
2 | #include <opencv2/opencv.hpp>
这是我的简单main.cpp:
#include <iostream>
#include <opencv2/opencv.hpp> //I have also tried using "" instead
我正在尝试用一个CMake项目来设置vcpkg。由于我打算让具有不同平台的多个人在这个项目上工作,所以我希望使用一个环境变量来设置CMAKE_TOOLCHAIN_FILE,而不是cmake:这里推荐的命令行参数
但是,CMake似乎无法找到VCPKG_ROOT环境变量。我将一个小示例与我的项目分开,以查看问题是否仍然存在,并且确实存在。这是我的CMakeLists.txt文件:
cmake_minimum_required (VERSION 3.8)
#vcpkg init
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_