cmake中如何将前缀路径添加到CMAKE_PREFIX_PATH
linux下,导入qt项目
执行cmakelist.txt时如下语句报错
find_package(Qt5Widgets REQUIRED)
报错信息如下:
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.
意思就是要添加qt5widgets的安装路径的前缀到CMAKE_PREFIX_PATH罗?但是我不知道要怎么将qt5widgets的安装路径添加到cmake_prefix_path呀。我在电脑上找到qt5widgets了,求dalao指点该怎么配置CMAKE_PREFIX_PATH,或者其他解决方案也当然感激不尽
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编译时加上 -DCMAKE_PREFIX_PATH=path/to/qt5widgets 试一试