c++ - 为什么我不能构建opencv WITH_QT?

标签 c++ opencv cmake qt5

我已经在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)"

最佳答案

我终于知道了:我在Qt目录中搜索Qt5Config.cmake,并在以下位置找到了它:“C:\ Qt \ 5.12.6 \ msvc2017_64 \ lib \ cmake \ Qt5”。

  • 现在,我在CMake中指定此目录,然后单击“配置”。一切正常。感谢你们。
  • 关于c++ - 为什么我不能构建opencv WITH_QT?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58933891/

    相关文章:

    c++ - 如何使用 QtDbus 注册接口(interface)和注册方法?

    c++ - `std::shared_ptr`自动循环断路器的可行性

    visual-studio - 将库添加到 Visual Studio 问题

    cmake - Clion 或 cmake 看不到环境变量

    c++ - CMake项目 build 的问题

    c++ - 是否可以在单行中获取第一种参数包?

    c++ - 什么是 Visual Studio 2010 中的测试项目?

    python - 在Python中读取给定目录中的图像文件

    OpenCV检测背景困难的方 block

    installation - 在 CMake 中条件排除已安装的文件