【发布时间】:2016-10-08 13:33:56
【问题描述】:
我在 Windows (MinGW) 上编译了 SFML,发现自己的目录结构包含 bin、include、lib 和 cmake/Modules/FindSFML.cmake 文件。
在CMakeLists.txt中找不到SFML的使用方法,不管是
find_package(SFML REQUIRED)
或
find_package(SFML CONFIG REQUIRED)
当我使用 cmake 时,我得到的只是:
CMake Error at CMakeLists.txt:34 (find_package):
Could not find a package configuration file provided by "SFML" with any of
the following names:
SFMLConfig.cmake
sfml-config.cmake
Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
"SFML_DIR" to a directory containing one of the above files. If "SFML"
provides a separate development package or SDK, be sure it has been
installed.
我尝试手动设置:
SFML_DIR:PATH=E:/code/libraries/SFML-2.4.0
CMAKE_MODULE_PATH:PATH=E:/code/libraries/SFML-2.4.0
或
CMAKE_MODULE_PATH:PATH=E:/code/libraries/SFML-2.4.0/cmake/modules
但我没有任何进展。
【问题讨论】:
-
这个答案有帮助吗? stackoverflow.com/a/39126731/2799037
-
请添加您的 cmake 调用。为什么要加
cmake/modules?为什么是 CMAKE_MODULE_PATH 而不是 CMAKE_PREFIX 路径?