在依赖于PCL的程序编译时,可能会找不到用于编译PCL的依赖项。

3

我正尝试构建treeseg,它需要使用PCL。

我已成功从源代码编译了PCL(耶!),但是当我尝试构建treeseg时,编译器找不到PCL已经使用的任何软件包,例如flann。

这是CMakeLists.txt文件(我已编辑以便其找到PCL):

cmake_minimum_required(VERSION 3.10)
project(treeseg)

set(PCL_DIR "/home/users/pwilkes/opt/pcl-pcl-1.10.0/build") # my edit
find_package(PCL 1.10 REQUIRED)
#find_package(Armadillo 9.8 REQUIRED)

include_directories(${PCL_INCLUDE_DIRS} ${ARMADILLO_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/riegl)
link_directories(${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/lib/riegl)

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
        if(EXISTS "${CMAKE_SOURCE_DIR}/lib/riegl/libscanifc-mt.so")
                add_executable(rxp2pcd ${CMAKE_SOURCE_DIR}/src/rxp2pcd.cpp)
                target_link_libraries(rxp2pcd treeseg scanifc-mt)
        endif()
        else()  
                message(WARNING "rxp executables not building because either RIEGL libs/headers not found, or not a compatible OS.")
endif()
cmake 的截断输出
>     CMake Warning at /home/users/pwilkes/opt/pcl-pcl-1.10.0/build/PCLConfig.cmake:257
> (find_package):
>       By not providing "FindFLANN.cmake" in CMAKE_MODULE_PATH this project has
>       asked CMake to find a package configuration file provided by "FLANN", but
>       CMake did not find one.
>     
>       Could not find a package configuration file provided by "FLANN" with any of
>       the following names:
>     
>         FLANNConfig.cmake
>         flann-config.cmake

我的问题是,为什么PCL能够找到这些依赖项,而treeseg却不能?在RHEL上尝试编译。flann等已通过conda安装。

你最终解决了这个问题吗?我现在也在苦苦挣扎。 - foobarbecue
1个回答

0
所以,在我的情况下,是因为我从未运行过make install。当我这样做时,它创建了一个充满文件的pcl-1.9/Modules目录,例如FindFLANN.cmake。然后我只需设置PCL_DIR就可以了。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接