PCL库的位置PCLConfig.cmake和pcl-config.cmake文件

时间:2016-05-25 15:11:59

标签: cmake point-cloud-library

我使用以下命令安装了PCL。

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all

当我使用CMakeLists.txt

中的以下行编译我的PCL程序时
find_package(PCL 1.3 REQUIRED COMPONENTS)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

我有错误

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

   Could not find a package configuration file provided by "PCL" (requested
   version 1.3) with any of the following names:

     PCLConfig.cmake
     pcl-config.cmake

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

我无法在我的系统中找到PCLConfig.cmake和pcl-config.cmake。

我确实喜欢

  

找到PCLConfig.cmake

/home/ttt/.local/share/Trash/files/PCLConfig.cmake /home/ttt/.local/share/Trash/files/DemoApplications-master/Calculus/tv_auto_on_off/voxel-sdk/libvoxelpcl/VoxelPCLConfig.cmake.in /home/ttt/.local/share/Trash/files/config/VoxelPCLConfig.cmake.in /home/ttt/.local/share/Trash/files/voxelsdk.2/config/VoxelPCLConfig.cmake.in /home/ttt/.local/share/Trash/info/PCLConfig.cmake.trashinfo /home/ttt/Softwares/voxelsdk/config/VoxelPCLConfig.cmake.in /usr/lib/cmake/VoxelPCL/VoxelPCLConfig.cmake

有意义吗?

我试过

set(PCL_DIR "/home/ttt/.local/share/Trash/files/PCLConfig.cmake")
find_package(PCL 1.3 REQUIRED COMPONENTS)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

但仍然有同样的错误。 如何在我的系统中找到PCLConfig.cmake? 感谢

2 个答案:

答案 0 :(得分:1)

你应该为CMake指定PCL目录以找到它。

在终端运行中:

$ locate PCLConfig.cmake

然后,将找到的文件夹(不带文件名)添加到CMakeLists中,如下所示:

set(PCL_DIR "/found/folder/")
#change X.x to whatever version yo installed

旁注:/usr/share/pcl-x.x是pcl文件夹的常用路径。

答案 1 :(得分:1)

对于Ubuntu 18,当我遵循网站http://www.pointclouds.org/downloads/linux.html上提到的步骤时,我遇到了同样的问题。

您只需要运行 sudo apt安装libpcl-dev

因为在发行版(http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu/dists/)中未提及仿生产品