【发布时间】:2017-02-25 19:53:46
【问题描述】:
我正在尝试使用 cmake 的 find_package 函数来查找 glfw3 的安装,但我不太确定我是否理解说明。我已经下载了 glfw3 并按照说明进行了构建。
下载src,进入root,运行cmake ..
然后我在 Visual Studio 中打开主解决方案glfw.sln。我构建了解决方案,一切似乎都很好。我可以看到 lib 的创建位置和所有内容。在我自己的 cmake 项目中,当我使用 find_package(glfw3 REQUIRED) 时收到此错误:
By not providing "Findglfw.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "glfw", but
CMake did not find one.
Could not find a package configuration file provided by "glfw" with any of
the following names:
glfwConfig.cmake
glfw-config.cmake
Add the installation prefix of "glfw" to CMAKE_PREFIX_PATH or set
"glfw_DIR" to a directory containing one of the above files. If "glfw"
provides a separate development package or SDK, be sure it has been
installed.
我的印象是,一旦我运行并安装了另一个将包含在 glfw3 等其他项目中的 cmake 库,它就会在任何对 cmake 的调用都可以找到它的地方安装 glfw3config.cmake。有没有理由不发生这种情况?这个包含 *config.cmake 的文件夹通常位于哪里?
【问题讨论】:
标签: cmake