Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 9 additions & 27 deletions cloudini_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,14 @@ target_include_directories(data_path INTERFACE ${CMAKE_BINARY_DIR}/include)

##################################################################################

if(ament_cmake_FOUND)
message(STATUS "PCL found using ament_cmake")
find_package(pcl_ros REQUIRED)
set(PCL_SRC src/pcl_conversion.cpp)
find_package(PCL COMPONENTS common io QUIET)

if(PCL_FOUND)
message(STATUS "PCL found in system")
add_definitions(${PCL_DEFINITIONS})
set(PCL_SRC src/pcl_conversion.cpp)
else()
find_package(PCL QUIET)
if(PCL_FOUND)
message(STATUS "PCL found in system")
add_definitions(${PCL_DEFINITIONS})
link_directories(${PCL_LIBRARY_DIRS})
set(PCL_SRC src/pcl_conversion.cpp)
else()
message(STATUS "PCL NOT found")
endif()
message(STATUS "PCL NOT found")
endif()

##################################################################################
Expand Down Expand Up @@ -112,22 +105,13 @@ target_include_directories(cloudini_lib
$<INSTALL_INTERFACE:include>
)

if(ament_cmake_FOUND)
find_package(pcl_ros REQUIRED)
target_link_libraries(cloudini_lib PUBLIC ${pcl_ros_TARGETS})
else()
if(PCL_FOUND)
target_include_directories(cloudini_lib PUBLIC ${PCL_INCLUDE_DIRS})
target_link_libraries(cloudini_lib PUBLIC ${PCL_LIBRARIES})
endif()
endif()

target_link_libraries(cloudini_lib
PRIVATE
$<BUILD_INTERFACE:LZ4::lz4_static>
$<BUILD_INTERFACE:zstd::libzstd_static>
PUBLIC
${PCL_LIBRARIES}
${PCL_COMMON_LIBRARIES}
${PCL_IO_LIBRARIES}
)

if(NOT EMSCRIPTEN)
Expand Down Expand Up @@ -211,8 +195,6 @@ INSTALL( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/

if(ament_cmake_FOUND)
ament_export_targets(cloudini_libTargets HAS_LIBRARY_TARGET)
ament_export_libraries(cloudini_lib)
ament_export_dependencies(pcl_ros)
ament_export_include_directories(include)
ament_export_dependencies(PCL)
ament_package()
endif()
5 changes: 3 additions & 2 deletions cloudini_lib/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>lz4</depend>
<depend>libpcl-common</depend>
<depend>libpcl-io</depend>
<depend>libzstd-dev</depend>
<depend>lz4</depend>
<depend>mcap_vendor</depend>
<depend>pcl_ros</depend>

<test_depend>ament_cmake_gtest</test_depend>

Expand Down
2 changes: 1 addition & 1 deletion cloudini_lib/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ else()
GTest::gtest_main)

if(PCL_FOUND)
target_link_libraries(test_cloudini ${PCL_LIBRARIES} )
target_link_libraries(test_cloudini ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES})
endif()

endif()
Expand Down
28 changes: 17 additions & 11 deletions cloudini_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ find_package(pluginlib REQUIRED)
find_package(point_cloud_interfaces REQUIRED)
find_package(point_cloud_transport REQUIRED)
find_package(Draco QUIET)
find_package(PCL COMPONENTS common REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(pcl_ros REQUIRED)

set(PLUGIN_DEPS
pluginlib::pluginlib
Expand All @@ -36,16 +36,16 @@ target_include_directories(cloudini_ros
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
${PCL_INCLUDE_DIRS}
)

target_link_libraries(cloudini_ros
PUBLIC
${PLUGIN_DEPS}
${PCL_LIBRARIES}
${PCL_COMMON_LIBRARIES}
)

install(TARGETS cloudini_ros
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/cloudini_ros
Expand Down Expand Up @@ -104,7 +104,7 @@ add_executable(test_cloudini_subscriber test/test_cloudini_subscriber.cpp)

target_link_libraries(test_cloudini_subscriber
cloudini_ros
${PCL_LIBRARIES}
${PCL_COMMON_LIBRARIES}
)

target_include_directories(test_cloudini_subscriber
Expand All @@ -123,15 +123,13 @@ add_executable(test_plugin_subscriber test/test_plugin_subscriber.cpp)

target_link_libraries(test_plugin_subscriber
cloudini_ros
${PCL_LIBRARIES}
${PCL_COMMON_LIBRARIES}
${point_cloud_interfaces_TARGETS}
${pcl_conversions_TARGETS}
point_cloud_transport::point_cloud_transport
)

target_include_directories(test_plugin_subscriber
PRIVATE
${PCL_INCLUDE_DIRS}
${pcl_conversions_INCLUDE_DIRS}
)

Expand Down Expand Up @@ -178,6 +176,7 @@ target_include_directories(${PLUGIN_NAME} PRIVATE
)

install(TARGETS ${PLUGIN_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PLUGIN_NAME}
Expand All @@ -188,10 +187,17 @@ install(
DESTINATION include/${PLUGIN_NAME}
)


pluginlib_export_plugin_description_file(point_cloud_transport cloudini_plugins.xml)

ament_export_include_directories(include)
ament_export_libraries(cloudini_ros ${PLUGIN_NAME})
ament_export_dependencies(${PLUGIN_DEPS})
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
ament_export_dependencies(
pluginlib
rosbag2_cpp
point_cloud_transport
rclcpp
cloudini_lib
sensor_msgs
point_cloud_interfaces
PCL
)
ament_package()
Loading