C++ 在Windows上使用CMake设置Vulkan项目
到目前为止,我已经安装了MinGW、CMake和Vulkan SDK。我还根据下载了GLFW预编译二进制文件GLM和PkgConfig。然后我在CLion中创建了一个CMake项目。这是CMakeLists.txt的内容(我从中获得): 错误消息如下所示:C++ 在Windows上使用CMake设置Vulkan项目,c++,cmake,vulkan,C++,Cmake,Vulkan,到目前为止,我已经安装了MinGW、CMake和Vulkan SDK。我还根据下载了GLFW预编译二进制文件GLM和PkgConfig。然后我在CLion中创建了一个CMake项目。这是CMakeLists.txt的内容(我从中获得): 错误消息如下所示: CMake Error at CMakeLists.txt:15 (find_package): By not providing "Findglfw3.cmake" in CMAKE_MODULE_PATH this project
CMake Error at CMakeLists.txt:15 (find_package):
By not providing "Findglfw3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "glfw3", but
CMake did not find one.
Could not find a package configuration file provided by "glfw3" (requested
version 3.2) with any of the following names:
glfw3Config.cmake
glfw3-config.cmake
Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
"glfw3_DIR" to a directory containing one of the above files. If "glfw3"
provides a separate development package or SDK, be sure it has been
installed.
我还尝试使用pkg_搜索_模块(GLFW必需glfw3)替换find_软件包(glfw3.2必需),如上所述,但出现错误“未找到必需的“glfw3”和“未找到必需的“glm” 欢迎来到堆栈溢出!你试过留言里的说明了吗?您是否尝试将glfw3的安装目录添加到
CMAKE_PREFIX_PATH
变量中?@squareskittles如何操作?您可以在运行该变量时将其传递给CMAKE
。请参阅答案。@squareskittles我添加了-DCMAKE\u INSTALL\u PREFIX和-DCMAKE\u PREFIX\u PATH,并将它们指向包含文件的目录,但我收到了相同的错误。
CMake Error at CMakeLists.txt:15 (find_package):
By not providing "Findglfw3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "glfw3", but
CMake did not find one.
Could not find a package configuration file provided by "glfw3" (requested
version 3.2) with any of the following names:
glfw3Config.cmake
glfw3-config.cmake
Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
"glfw3_DIR" to a directory containing one of the above files. If "glfw3"
provides a separate development package or SDK, be sure it has been
installed.