【发布时间】:2019-11-19 12:14:26
【问题描述】:
我已经在我的 Windows 7 x64 上安装了 Qt5.12。还有 CMake 3.16。
我想构建 OpenCV-4.1.2。所以在 cmake 中我检查了WITH_QT 并将QT5_DIR 指定为:C:\\Qt\\5.12.6,然后单击配置。但我得到这个错误:
CMake Error at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
Could not find a package configuration file provided by "Qt5" with any of
the following names:
Qt5Config.cmake
qt5-config.cmake
Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files. If "Qt5" provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:669 (include)"
【问题讨论】:
-
C:\Qt\5.12.6 是否包含 Qt5Config.cmake 或 qt5-config.cmake?
-
您确定目录 C:\\Qt\\5.12.6 包含这些文件中的任何一个(Qt5Config.cmake 或 qt5-config.cmake)?
-
变量是区分大小写的,所以你应该按照它的建议设置
Qt5_DIR,而不是QT5_DIR