【问题标题】:Locations PCLConfig.cmake and pcl-config.cmake files for PCL libraryPCL 库的位置 PCLConfig.cmake 和 pcl-config.cmake 文件
【发布时间】:2016-09-23 07:07:52
【问题描述】:

我使用以下命令安装了 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? 谢谢

【问题讨论】:

  • 如错误消息中所述,PCL_DIR 应该是一个目录,包含所需的文件。垃圾中的文件不太适合。它应该类似于<...>/cmake/PCL/PCLConfig.cmake(类似于VoxelPCL 包的文件,输出中的最后一个文件)。在这种情况下,使用<...>/cmake/PCL 作为PCL_DIR 变量的值。

标签: cmake point-cloud-library


【解决方案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 文件夹的常用路径。

【讨论】:

  • Y 我的问题是我没有 /usr/share/pcl-X.x。我有 /usr/include/pcl-X.x。和 /usr/bin/libpcl* 中的 pcl 库文件。我怎样才能删除所有这些?我喜欢从源头重新安装。
  • 我在这里使用 (pointclouds.org/downloads/linux.html) 卸载并重新安装。它不会在 /usr/share/... 中创建任何内容。
  • 您的建议是正确的。但不知何故,它通过从源代码安装对我有用。 s
  • @Vtik,在 Windows 10 中做什么?
【解决方案2】:

当我按照网站 http://www.pointclouds.org/downloads/linux.html 上提到的步骤操作时,我遇到了同样的问题,适用于 Ubuntu 18。

您只需要运行 sudo apt install libpcl-dev

因为分布中没有提到仿生 (http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu/dists/)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多