-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
90 lines (72 loc) · 2.64 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
cmake_minimum_required(VERSION 2.8.3)
project(mastering_ros_demo_pkg)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
actionlib
actionlib_msgs
message_generation
)
## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system)
add_message_files(
FILES
demo_msg.msg
)
## Generate services in the 'srv' folder
add_service_files(
FILES
demo_srv.srv
)
## Generate actions in the 'action' folder
add_action_files(
FILES
Demo_action.action
)
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
actionlib_msgs
)
catkin_package(
CATKIN_DEPENDS roscpp rospy std_msgs actionlib actionlib_msgs message_runtime
)
include_directories(
include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
#Topic publisher
add_executable(demo_topic_publisher src/demo_topic_publisher.cpp)
add_dependencies(demo_topic_publisher mastering_ros_demo_pkg_generate_messages_cpp)
target_link_libraries(demo_topic_publisher ${catkin_LIBRARIES})
#Topic subscriber
add_executable(demo_topic_subscriber src/demo_topic_subscriber.cpp)
add_dependencies(demo_topic_subscriber mastering_ros_demo_pkg_generate_messages_cpp)
target_link_libraries(demo_topic_subscriber ${catkin_LIBRARIES})
#Custom message publisher
add_executable(demo_msg_publisher src/demo_msg_publisher.cpp)
add_dependencies(demo_msg_publisher mastering_ros_demo_pkg_generate_messages_cpp)
target_link_libraries(demo_msg_publisher ${catkin_LIBRARIES})
#Custom message subscriber
add_executable(demo_msg_subscriber src/demo_msg_subscriber.cpp)
add_dependencies(demo_msg_subscriber mastering_ros_demo_pkg_generate_messages_cpp)
target_link_libraries(demo_msg_subscriber ${catkin_LIBRARIES})
#Demo service server
add_executable(demo_service_server src/demo_service_server.cpp)
add_dependencies(demo_service_server mastering_ros_demo_pkg_generate_messages_cpp)
target_link_libraries(demo_service_server ${catkin_LIBRARIES})
#Demo service client
add_executable(demo_service_client src/demo_service_client.cpp)
add_dependencies(demo_service_client mastering_ros_demo_pkg_generate_messages_cpp)
target_link_libraries(demo_service_client ${catkin_LIBRARIES})
#Demo action server
add_executable(demo_action_server src/demo_action_server.cpp)
add_dependencies(demo_action_server mastering_ros_demo_pkg_generate_messages_cpp)
target_link_libraries(demo_action_server ${catkin_LIBRARIES} )
#Demo action client
add_executable(demo_action_client src/demo_action_client.cpp)
add_dependencies(demo_action_client mastering_ros_demo_pkg_generate_messages_cpp)
target_link_libraries(demo_action_client ${catkin_LIBRARIES})