使用cmake生成PCL项目时报错解决方法

1 篇文章 0 订阅
1 篇文章 0 订阅

使用cmake编译PCL时报如下错误的解决方法

CMake Error at C:/Program Files (x86)/PCL 1.8.0/3rdParty/VTK/lib/cmake/vtk-7.0/Modules/vtkGUISupportQt.cmake:17 (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.
Call Stack (most recent call first):
C:/Program Files (x86)/PCL 1.8.0/3rdParty/VTK/lib/cmake/vtk-7.0/vtkModuleAPI.cmake:45 (include)
C:/Program Files (x86)/PCL 1.8.0/3rdParty/VTK/lib/cmake/vtk-7.0/vtkModuleAPI.cmake:15 (vtk_module_load)
C:/Program Files (x86)/PCL 1.8.0/3rdParty/VTK/lib/cmake/vtk-7.0/vtkModuleAPI.cmake:132 (_vtk_module_config_recurse)
C:/Program Files (x86)/PCL 1.8.0/3rdParty/VTK/lib/cmake/vtk-7.0/VTKConfig.cmake:88 (vtk_module_config)
C:/Program Files (x86)/PCL 1.8.0/cmake/PCLConfig.cmake:487 (find_package)
C:/Program Files (x86)/PCL 1.8.0/cmake/PCLConfig.cmake:645 (find_VTK)
C:/Program Files (x86)/PCL 1.8.0/cmake/PCLConfig.cmake:832 (find_external_library)
CMakeLists.txt:7 (find_package)
 

Configuring incomplete, errors occurred!

 

解决方法1:修改CMakeLists.txt

在find_package前添加一行set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.5.1/5.5/msvc2013")

解决方法2:修改系统变量

在系统变量中新加一项

变量名为CMAKE_PREFIX_PATH

变量值为C:/Qt/Qt5.5.1/5.5/msvc2013

运行结果:

参考:https://github.com/Cockatrice/Cockatrice/issues/205

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值