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

bat*_*man 4 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
Run Code Online (Sandbox Code Playgroud)

当我用以下几行编译我的 PCL 程序时CMakeLists.txt

find_package(PCL 1.3 REQUIRED COMPONENTS)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
Run Code Online (Sandbox Code Playgroud)

我有错误

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.
Run Code Online (Sandbox Code Playgroud)

我在系统中找不到 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})
Run Code Online (Sandbox Code Playgroud)

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

Vti*_*tik 5

您应该指定 PCL 目录以便 CMake 找到它。

在终端运行:

$ locate PCLConfig.cmake
Run Code Online (Sandbox Code Playgroud)

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

set(PCL_DIR "/found/folder/")
#change X.x to whatever version yo installed
Run Code Online (Sandbox Code Playgroud)

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