Ubuntu 下编译CloudCompare

CloudCompare作为一个查看和编辑3D数据的开源软件,在ubuntu下编译不算太麻烦,但是坑也是有的,记录一下所踩的坑。

  • 环境: Ubuntu 16.04 64 位

官网 http://www.cloudcompare.org/

https://github.com/cloudcompare/cloudcompare

在官网上有Ubuntu 的安装方法

snap install cloudcompare

原文如下:

Now thanks to Alberto Mardegan (and Romain Janvier), there is a "universal" snap package for Linux.
On Ubuntu, starting from version 16.04 it's as simple as typing "snap install cloudcompare".
On other distributions, you may need to install snap first (please refer to the corresponding documentation if necessary).
Snaps are published in 3 channels: "stable", "beta", and "edge".
The "stable" and the "beta" channel deliver the latest stable and beta versions of CloudCompare while "edge" delivers nightly builds and may eat your laundry. You can switch at any time between these three channels by launching "sudo snap refresh --<channel name>" in your terminal.

github也有源码编译的方法,比较简单。

git clone --recursive https://github.com/cloudcompare/trunk.git
cd trunk
mkdir build
cd build
cmake ..
make -j8
sudo make install

但是这样得到的cloudcompare ,不能打开pcd文件。所以需要重现编译源码。
cmake ..之后

ccmake  ..

开启 INSTALL_QPCL_PLUGIN选项
再编译安装

Ubuntu上的PCL库容易报/usr/bin/ld: cannot find -lvtkproj4 collect2错误 ,解决办法是加上
cloudcompare/plugins/qPCL/CMakeLists.txt中增加一行

list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")

完整如下

cmake_minimum_required(VERSION 3.0)
option( INSTALL_QPCL_PLUGIN "Check to install qPCL plugin" OFF )

# CloudCompare 'PCL' bridge plugin
if (INSTALL_QPCL_PLUGIN)
    #requires PCL
    find_package(PCL REQUIRED)

    list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")
    #PCL bridge library
    add_subdirectory(PclUtils)

    #CloudCompare 'qPCLIO' I/O plugin (to load PCD files)
    add_subdirectory(PclIO)

    project( QPCL_PLUGIN )

    #documentation
    add_subdirectory(doc)

    include_directories( ${QPCL_PLUGIN_UTILS_LIB_SOURCE_DIR}/filters )
    include_directories( ${QPCL_PLUGIN_UTILS_LIB_BINARY_DIR} )
    include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../ ) #the plugin dir
    include_directories( ${PCL_INCLUDE_DIRS} )

    include( ../CMakePluginTpl.cmake )
    target_link_libraries(${PROJECT_NAME} QPCL_PLUGIN_UTILS_LIB)

    link_directories( ${PCL_LIBRARY_DIRS} )
    add_definitions( ${PCL_DEFINITIONS} )

    #import PCL dlls (if any, WIN32 only)
    include( ExportPCLDlls.cmake )
    list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")
    export_PCL_dlls( ${CLOUDCOMPARE_DEST_FOLDER} )
endif()


cloudcompare/plugins/qPCL/PclUtils/CMakeLists.txt
cloudcompare/plugins/qPCL/PclIO/CMakeLists.txt里也增加这一行

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值