From af66991a3e86ac950639cd6bed03b2b901503f0a Mon Sep 17 00:00:00 2001 From: duongtd Date: Tue, 25 Aug 2026 12:38:48 +0700 Subject: [PATCH] =?UTF-8?q?build:=20b=E1=BB=8F=20dependency=20PCL=20kh?= =?UTF-8?q?=C3=B4ng=20d=C3=B9ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gói không include một header pcl/ nào — đây là di sản từ thời còn dùng pcl_ros. Trên robot aarch64 có VTK 9.1 build kèm MPI, chuỗi PCL -> VTK -> VTK::mpi -> MPI::MPI_C làm CMake gãy ở generate step: root project khai LANGUAGES CXX nên find_package(MPI COMPONENTS C) không bao giờ thành công và target MPI::MPI_C không được tạo. Component io là chỗ kéo VTK vào. Máy dev không dính vì không cài VTK cmake package, find_VTK() tìm không thấy rồi bỏ qua trong im lặng. Bỏ find_package, DEPENDS PCL, PCL_INCLUDE_DIRS, PCL_LIBRARIES, link_directories(PCL_LIBRARY_DIRS) và PCL_DEFINITIONS. --- CMakeLists.txt | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81f3a62..c5d2c8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,6 @@ find_package(Boost REQUIRED COMPONENTS system thread filesystem) # does not produce. QUIET, not REQUIRED: a robot without GTest installed must # still configure. The test block below requires it where it is actually used. find_package(GTest QUIET) -find_package(PCL REQUIRED COMPONENTS common io) find_package(yaml-cpp REQUIRED) if (NOT BUILDING_WITH_CATKIN) @@ -81,7 +80,7 @@ else() INCLUDE_DIRS include LIBRARIES robot_costmap_2d plugins CATKIN_DEPENDS robot_std_msgs robot_sensor_msgs geometry_msgs robot_nav_msgs robot_map_msgs robot_laser_geometry robot_visualization_msgs robot_voxel_grid robot_tf3_geometry_msgs robot_tf3_sensor_msgs data_convert robot_xmlrpcpp robot_cpp robot_time - DEPENDS PCL Boost + DEPENDS Boost ) include_directories( @@ -90,17 +89,15 @@ else() ${EIGEN3_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} - ${PCL_INCLUDE_DIRS} ${TF3_INCLUDE_DIR} ) - link_directories(${PCL_LIBRARY_DIRS}) endif() # Define macro để dùng trong code add_definitions(-DROBOT_COSTMAP_2D_DIR="${CMAKE_CURRENT_SOURCE_DIR}") -# Eigen và PCL definitions -add_definitions(${EIGEN3_DEFINITIONS} ${PCL_DEFINITIONS}) +# Eigen definitions +add_definitions(${EIGEN3_DEFINITIONS}) # ======================================================== # Core library: robot_costmap_2d @@ -126,7 +123,6 @@ if(BUILDING_WITH_CATKIN) $ ${EIGEN3_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - ${PCL_INCLUDE_DIRS} ${TF3_INCLUDE_DIR} ) @@ -135,7 +131,6 @@ if(BUILDING_WITH_CATKIN) PRIVATE Boost::boost Boost::system Boost::thread Boost::filesystem PRIVATE yaml-cpp PRIVATE dl - PRIVATE ${PCL_LIBRARIES} PRIVATE ${TF3_LIBRARY} ) @@ -147,7 +142,6 @@ else() $ ${EIGEN3_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - ${PCL_INCLUDE_DIRS} ${TF3_INCLUDE_DIR} ) @@ -158,7 +152,6 @@ else() Boost::boost Boost::system Boost::thread Boost::filesystem yaml-cpp dl - ${PCL_LIBRARIES} ${TF3_LIBRARY} ) @@ -274,7 +267,7 @@ else() message(STATUS "Version: ${PROJECT_VERSION}") message(STATUS "C++ Standard: ${CMAKE_CXX_STANDARD}") message(STATUS "Libraries: robot_costmap_2d, plugins") - message(STATUS "Dependencies: robot_std_msgs, robot_sensor_msgs, geometry_msgs, robot_nav_msgs, robot_map_msgs, robot_laser_geometry, robot_visualization_msgs, robot_voxel_grid, tf3, robot_tf3_geometry_msgs, robot_tf3_sensor_msgs, data_convert, robot_xmlrpcpp, robot_cpp, robot_time, Eigen3, PCL, Boost, yaml-cpp") + message(STATUS "Dependencies: robot_std_msgs, robot_sensor_msgs, geometry_msgs, robot_nav_msgs, robot_map_msgs, robot_laser_geometry, robot_visualization_msgs, robot_voxel_grid, tf3, robot_tf3_geometry_msgs, robot_tf3_sensor_msgs, data_convert, robot_xmlrpcpp, robot_cpp, robot_time, Eigen3, Boost, yaml-cpp") message(STATUS "=================================") endif()