c – 如何解决mac中的qt5(未找到包)cmake错误?

在使用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错误? - 代码日志