安装完PCL all_in_one 之后,使用CMake将例程生成为VS2013的工程
配置完成选择生成后界面如下:
有问题的有三行,如图红线所示:
1. OPENNI_INCLUDE_DIRS-NOTFOUND
2. OPENNI_LIBRARY-NOTFOUND
3. VTK_DIR-NOTFOUND
其中:1、2不是关键配置,只会导致警报。
3是导致生成失败的主要原因。
详细报错信息如下图所示:
Could NOT find openni (missing: OPENNI_LIBRARY OPENNI_INCLUDE_DIRS)
* WARNING * io features related to openni will be disabled
* WARNING * io features related to pcap will be disabled
* WARNING * io features related to png will be disabled
CMake Warning at C:/Program Files/PCL 1.7.2/cmake/PCLConfig.cmake:291 (find_package):
By not providing “FindVTK.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “VTK”, but
CMake did not find one.
Could not find a package configuration file provided by “VTK” with any of
the following names:
VTKConfig.cmake
vtk-config.cmake
Add the installation prefix of “VTK” to CMAKE_PREFIX_PATH or set “VTK_DIR”
to a directory containing one of the above files. If “VTK” provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
C:/Program Files/PCL 1.7.2/cmake/PCLConfig.cmake:429 (find_VTK)
C:/Program Files/PCL 1.7.2/cmake/PCLConfig.cmake:615 (find_external_library)
CMakeLists.txt:3 (find_package)
…
…
…
CMake Error at C:/Program Files/PCL 1.7.2/cmake/PCLConfig.cmake:44 (message):
visualization is required but vtk was not found
Call Stack (most recent call first):
C:/Program Files/PCL 1.7.2/cmake/PCLConfig.cmake:459 (pcl_report_not_found)
C:/Program Files/PCL 1.7.2/cmake/PCLConfig.cmake:618 (find_external_library)
CMakeLists.txt:3 (find_package)
解决方案:
找到PCLConfig.cmake所在文件夹C:\PCL 1.7.2\cmake,将PCLConfig.cmake第293行
查看所安装PCL的VTKConfig.make所在的目录:
将PCLConfig.cmake第293行改为相应的目录:
点击生成,成功生成项目,并且只剩下,几个警告。