Skip to content

Commit a63f9e9

Browse files
committed
Update to use modern CMake idioms
Signed-off-by: Alberto Tudela <[email protected]>
1 parent a8d3b88 commit a63f9e9

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

CHANGELOG.rst

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Changelog for package laser_segmentation
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
3.0.2 (31-07-2024)
6+
------------------
7+
* Update to use modern CMake idioms.
8+
59
3.0.1 (12-06-2024)
610
------------------
711
* Remove nav2_util dependency.

CMakeLists.txt

+5-9
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,22 @@ target_include_directories(${library_name}
7777
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
7878
target_link_libraries(${library_name}
7979
PUBLIC
80+
rclcpp::rclcpp
8081
rclcpp_lifecycle::rclcpp_lifecycle
81-
${rclcpp_components_TARGETS}
8282
${sensor_msgs_TARGETS}
8383
${slg_msgs_TARGETS}
84+
slg_msgs::slg_core
8485
${visualization_msgs_TARGETS}
8586
PRIVATE
86-
rclcpp::rclcpp
87+
rclcpp_components::component
8788
)
8889

8990
# Add executables
9091
add_executable(${PROJECT_NAME} src/main.cpp)
91-
target_include_directories(${PROJECT_NAME}
92-
PUBLIC
93-
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>"
94-
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
9592
target_link_libraries(${PROJECT_NAME}
96-
PUBLIC
97-
rclcpp_lifecycle::rclcpp_lifecycle
9893
PRIVATE
99-
rclcpp::rclcpp
10094
${library_name}
95+
rclcpp::rclcpp
10196
)
10297

10398
rclcpp_components_register_nodes(${library_name} "laser_segmentation::LaserSegmentation")
@@ -106,6 +101,7 @@ rclcpp_components_register_nodes(${library_name} "laser_segmentation::LaserSegme
106101
# # Install ##
107102
# ############
108103
install(TARGETS ${library_name}
104+
EXPORT ${library_name}
109105
ARCHIVE DESTINATION lib
110106
LIBRARY DESTINATION lib
111107
RUNTIME DESTINATION bin

include/laser_segmentation/laser_segmentation.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ class LaserSegmentation : public rclcpp_lifecycle::LifecycleNode
129129
* @return slg_msgs::msg::SegmentArray The segment array message
130130
*/
131131
visualization_msgs::msg::MarkerArray create_segment_viz_points(
132-
std_msgs::msg::Header header,
133-
std::vector<slg::Segment2D> segment_list);
132+
std_msgs::msg::Header header, std::vector<slg::Segment2D> segment_list);
134133

135134
/**
136135
* @brief Get the parula color object

include/laser_segmentation/parameter_handler.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
#include <string>
2020
#include <vector>
2121

22-
#include "rclcpp/rclcpp.hpp"
22+
#include "rclcpp/logger.hpp"
23+
#include "rclcpp/parameter.hpp"
2324
#include "rclcpp_lifecycle/lifecycle_node.hpp"
25+
#include "rcl_interfaces/msg/set_parameters_result.hpp"
2426

2527
namespace laser_segmentation
2628
{

package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>laser_segmentation</name>
5-
<version>3.0.1</version>
5+
<version>3.0.2</version>
66
<description>Implementation of algorithms for segmentation of laserscans.</description>
77
<maintainer email="[email protected]">Alberto Tudela</maintainer>
88
<maintainer email="[email protected]">Manuel Fernandez-Carmona</maintainer>

test/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Test for segmentations algorithm
22
ament_add_gtest(test_segmentations test_segmentations.cpp)
3-
target_link_libraries(test_segmentations ${library_name} ${slg_msgs_TARGETS})
3+
target_link_libraries(test_segmentations ${library_name} slg_msgs::slg_core)
44

55
# Test for laser_segmentation
66
ament_add_gtest(test_laser_segmentation test_laser_segmentation.cpp)

0 commit comments

Comments
 (0)