File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -17,23 +17,27 @@ if(${ROS_VERSION} EQUAL 2)
17
17
18
18
find_package (mqtt_client_interfaces REQUIRED )
19
19
find_package (rclcpp REQUIRED )
20
- find_package (sensor_msgs REQUIRED )
21
20
find_package (std_msgs REQUIRED )
22
21
23
- find_package (PahoMqttCpp REQUIRED )
24
- set (PahoMqttCpp_LIBRARIES PahoMqttCpp::paho-mqttpp3 )
22
+ # Paho MQTT C++ apt package doesn't include cMake config
23
+ # find_package(PahoMqttCpp REQUIRED)
24
+ find_library (PahoMqttC_LIBRARY libpaho-mqtt3as.so.1 REQUIRED )
25
+ find_library (PahoMqttCpp_LIBRARY libpaho-mqttpp3.so.1 REQUIRED )
25
26
26
27
add_executable (${PROJECT_NAME} src/MqttClient.ros2.cpp )
27
28
28
29
target_include_directories (${PROJECT_NAME} PUBLIC
29
30
$< BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>
30
31
$< INSTALL_INTERFACE:include> )
31
32
33
+ target_link_libraries (${PROJECT_NAME}
34
+ ${PahoMqttC_LIBRARY}
35
+ ${PahoMqttCpp_LIBRARY}
36
+ )
37
+
32
38
ament_target_dependencies (${PROJECT_NAME}
33
39
mqtt_client_interfaces
34
- PahoMqttCpp
35
40
rclcpp
36
- sensor_msgs
37
41
std_msgs
38
42
)
39
43
@@ -287,4 +291,4 @@ elseif(${ROS_VERSION} EQUAL 1)
287
291
## Add folders to be run by python nosetests
288
292
# catkin_add_nosetests(test)
289
293
290
- endif ()
294
+ endif ()
Original file line number Diff line number Diff line change 23
23
24
24
<!-- ROS2 -->
25
25
<buildtool_depend condition =" $ROS_VERSION == 2" >ament_cmake</buildtool_depend >
26
+ <depend condition =" $ROS_VERSION == 2" >libpaho-mqtt-dev</depend >
27
+ <depend condition =" $ROS_VERSION == 2" >libpaho-mqttpp-dev</depend >
26
28
<depend condition =" $ROS_VERSION == 2" >rclcpp</depend >
27
29
<depend condition =" $ROS_VERSION == 2" >rcpputils</depend >
28
30
39
41
<nodelet condition =" $ROS_VERSION == 1" plugin =" ${prefix}/nodelet_plugins.xml" />
40
42
</export >
41
43
42
- </package >
44
+ </package >
You can’t perform that action at this time.
0 commit comments