fix compile error

This commit is contained in:
NuoDaJia02
2025-12-08 11:59:14 +08:00
parent 67d077a0a1
commit ccff9cd50f
7 changed files with 34 additions and 17 deletions

View File

@@ -25,16 +25,30 @@ find_package(yaml-cpp 0.6 REQUIRED)
find_package(OpenMP)
find_package(Eigen3)
set(WORKSPACE_ROOT "/home/demo/hivecore_robot_os1/hivecore_robot_slam/")
set(CMAKE_PREFIX_PATH "/home/demo/deps_install" ${CMAKE_PREFIX_PATH})
set(CMAKE_INCLUDE_PATH "/home/demo/deps_install/include" ${CMAKE_INCLUDE_PATH})
set(CMAKE_LIBRARY_PATH "/home/demo/deps_install/lib" ${CMAKE_LIBRARY_PATH})
set(CMAKE_PREFIX_PATH "${WORKSPACE_ROOT}deps_install" ${CMAKE_PREFIX_PATH})
set(CMAKE_INCLUDE_PATH "${WORKSPACE_ROOT}deps_install/include" ${CMAKE_INCLUDE_PATH})
set(CMAKE_LIBRARY_PATH "${WORKSPACE_ROOT}deps_install/lib" ${CMAKE_LIBRARY_PATH})
set(PCL_DIR "${WORKSPACE_ROOT}deps_install/share/pcl-1.10")
set(PCL_DIR /home/demo/deps_install/share/pcl-1.10)
set(PCL_ROOT "${WORKSPACE_ROOT}deps_install")
set(PCL_ROOT /home/demo/deps_install)
find_package(PCL 1.10 REQUIRED)
find_package(PCL REQUIRED)
set(PCL_LIBRARIES_ABS "")
foreach(lib ${PCL_LIBRARIES})
string(STRIP "${lib}" lib)
if("${lib}" MATCHES "^pcl_")
set(lib_path "${WORKSPACE_ROOT}deps_install/lib/lib${lib}.so")
if(EXISTS "${lib_path}")
list(APPEND PCL_LIBRARIES_ABS "${lib_path}")
endif()
else()
list(APPEND PCL_LIBRARIES_ABS "${lib}")
endif()
endforeach()
set(PCL_LIBRARIES ${PCL_LIBRARIES_ABS})
message("##################" ${PCL_INCLUDE_DIRS})
message("##################" ${PCL_LIBRARIES})
@@ -47,23 +61,23 @@ if (OPENMP_FOUND)
endif()
include_directories(
${PCL_INCLUDE_DIRS}
${WORKSPACE_ROOT}deps_install/include/pcl-1.10
include/${PROJECT_NAME}
${pcl_conversions_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${YAML_CPP_INCLUDE_DIR}
/user/include
/home/demo/deps_install/include/pcl-1.10
)
link_directories(
/home/demo/deps_install/lib
${WORKSPACE_ROOT}deps_install/lib
)
add_subdirectory(src)
#add_subdirectory(apps/nodelets)
add_subdirectory(apps/nodelets)
install(
DIRECTORY launch

View File

@@ -7,6 +7,7 @@ target_link_libraries(lio_locus_node
point_cloud_localization
point_cloud_mapper
boost_filesystem
${PCL_LIBRARIES}
)
target_include_directories(lio_locus_node PUBLIC
@@ -73,6 +74,7 @@ add_executable(cloud_preprocessing_node cloud_preprocessing_node.cpp)
target_link_libraries(cloud_preprocessing_node
cloud_pre_processor
boost_filesystem
${PCL_LIBRARIES}
)
#target_include_directories(cloud_preprocessing_node PUBLIC

View File

@@ -1,5 +1,5 @@
add_subdirectory(point_cloud_odometry)
add_subdirectory(point_cloud_localization)
add_subdirectory(point_cloud_mapper)
#add_subdirectory(lio_locus)
add_subdirectory(lio_locus)

View File

@@ -6,7 +6,7 @@ target_link_libraries(${PROJECT_NAME}
point_cloud_mapper
boost_filesystem
glog
${PCL_LIBRARIES}
${PCL_LIBRARIES}
pcl_common
${YAML_CPP_LIBRARIES}
)
@@ -25,6 +25,7 @@ add_library(cloud_pre_processor SHARED cloud_pre_processor.cpp)
target_link_libraries(cloud_pre_processor
pcl_filters
pcl_features
${PCL_LIBRARIES}
boost_filesystem
glog
${YAML_CPP_LIBRARIES})

View File

@@ -2,7 +2,7 @@ add_library(point_cloud_localization SHARED
PointCloudLocalization.cc utils.cc)
target_link_libraries(point_cloud_localization
# ${PCL_LIBRARIES}
${PCL_LIBRARIES}
pcl_octree
pcl_filters
pcl_search

View File

@@ -6,12 +6,12 @@ add_library(point_cloud_mapper SHARED
target_include_directories(point_cloud_mapper PUBLIC
# ${PCL_INCLUDE_DIRS}
/home/demo/deps_install/include/pcl-1.10
${PCL_INCLUDE_DIRS}
${WORKSPACE_ROOT}deps_install/include/pcl-1.10
)
target_link_libraries(point_cloud_mapper
${PCL_LIBRARIRES}
${PCL_LIBRARIES}
${YAML_CPP_LIBRARIES}
glog
OpenMP::OpenMP_CXX

View File

@@ -7,7 +7,7 @@ add_library(point_cloud_odometry SHARED PointCloudOdometry.cc)
target_link_libraries(point_cloud_odometry
glog
# ${PCL_LIBRARIES}
${PCL_LIBRARIES}
pcl_octree
pcl_filters
pcl_search