在使用 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
有人知道如何解决这个问题吗?提前致谢
原文由 D.vijay 发布,翻译遵循 CC BY-SA 4.0 许可协议
您应该在 Qt 安装中找到 cmake 包:
假设
<install_prefix>
是您安装的根路径。在您的配置中将变量 Qt5_DIR 设置为<install_prefix>/lib/cmake/Qt5
并且 cmake 应该能够找到所有模块