指定Boost路径(根目录下):
set(BOOST_ROOT "/usr/lib/x86_64-linux-gnu")
指定路径OpenCV(外部home路径):
set(OpenCV_DIR "/home/nuc/opencv/opencv/build")
查找PCL路径(外部home路径):
find_package(PCL REQUIRED)
这种方式有可能找到的是根目录下的PCL也有可能是外部home路径,我们可以通过下述方法查看一下:
message(STATUS "PCL_INCLUDE_DIRS:" ${PCL_INCLUDE_DIRS}) message(STATUS "PCL_LIBRARY_DIRS:" ${PCL_LIBRARY_DIRS}) message(STATUS "PCL_DEFINITIONS:" ${PCL_DEFINITIONS})
注意要记得链接到库:
target_link_libraries(your lib name ${PCL_LIBRARIES})