c++ - 如何解决 mac 中的 qt5(未找到软件包)cmake 错误?

标签 c++ macos qt cmake qt5

我在使用 CMake 构建文件期间遇到以下错误:

CMake Warning at CMakeLists.txt:33 (FIND_PACKAGE):

By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Core", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Core" with any of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

有人知道怎么解决吗?提前致谢

最佳答案

您应该在您的 Qt 安装中找到 cmake 包:

<install_prefix>/lib/cmake

假设<install_prefix>是安装的根路径。将变量 Qt5_DIR 设置为 <install_prefix>/lib/cmake/Qt5在您的配置中,cmake 应该能够找到所有模块

关于c++ - 如何解决 mac 中的 qt5(未找到软件包)cmake 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38746635/

相关文章:

C++:显示控制台窗口的输出

qt - 样式表可以更改 QPlainTextEdit 中的文本颜色吗?

qt - 在 Qt 4.8.0 中使用 OpenCV 2.3.1 时应用程序在启动时崩溃

c++ - EnhTableWidget 字段的值更改(返回前)时发出信号

c++ - 如何在 NS2 中查找节点 ID?

c++ - 如何使用 opencv flann::Index?

c++ - 为什么当我没有为它分配新值时,变量的值会改变?

javascript - HTML5 <audio> 流 OSX Safari 错误

macos - 如何在 MacOS 终端 Sierra 上安装 gdb

python - REDIS BGSAVE 断言失败,由信号 6 终止。(macos/python)