gpt4 book ai didi

c++ - 将 "Qt5Widgets"的安装前缀添加到CMAKE_PREFIX_PATH

转载 作者:IT老高 更新时间:2023-10-28 12:53:42 28 4
gpt4 key购买 nike

我不太了解 cmake,我正在尝试使用 cmake 和 Qt 构建客户端。收到以下错误:

CMake Error at alethzero/CMakeLists.txt:26 (find_package): By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.

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

Qt5WidgetsConfig.cmake
qt5widgets-config.cmake

Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set "Qt5Widgets_DIR" to a directory containing one of the above files. If "Qt5Widgets" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred!

据我了解,我需要将 QT 路径添加到 CMake。我该怎么做?我在/home/user/Programs 中安装了 Qt。我找到的所有解释都是“做这个或那个”。我需要确切的终端命令,以便将来学习如何操作。

谢谢!

更新:export CMAKE_PREFIX_PATH=/home/user/Programs 对我没有帮助。

最佳答案

好吧,这里有一个适用于 Windows 的解决方案:How to find qt5 CMake module on windows

set (CMAKE_PREFIX_PATH "C:\\Qt\\Qt5.0.1\\5.0.1\\msvc2010\\")

对于您的环境,我认为您将不得不更改Qt所在的路径...

也许这会对你有所帮助:
https://github.com/Cockatrice/Cockatrice/issues/205

关于c++ - 将 "Qt5Widgets"的安装前缀添加到CMAKE_PREFIX_PATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22215900/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com