-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (69 loc) · 1.95 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
cmake_minimum_required(VERSION 2.8.3)
project(ros_service_example)
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
find_package(catkin REQUIRED COMPONENTS
actionlib
actionlib_msgs
message_generation
roscpp
std_msgs
)
## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )
## Generate services in the 'srv' folder
add_service_files(
FILES
AddNumbers.srv
ReverseString.srv
)
## Generate actions in the 'action' folder
add_action_files(
DIRECTORY
action
FILES
CountTo.action
)
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
actionlib_msgs
std_msgs
)
catkin_package(
# INCLUDE_DIRS include
CATKIN_DEPENDS
actionlib
actionlib_msgs
message_generation
roscpp
std_msgs
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
${smartgv_utils_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
# Services
add_executable(ex_add_numbers src/add_numbers.cpp)
add_dependencies(ex_add_numbers ${catkin_EXPORTED_TARGETS} ros_service_example_gencpp)
target_link_libraries(ex_add_numbers ${catkin_LIBRARIES})
set_target_properties(ex_add_numbers PROPERTIES OUTPUT_NAME add_numbers)
add_executable(ex_reverse_string src/reverse_string.cpp)
add_dependencies(ex_reverse_string ${catkin_EXPORTED_TARGETS} ros_service_example_gencpp)
target_link_libraries(ex_reverse_string ${catkin_LIBRARIES})
set_target_properties(ex_reverse_string PROPERTIES OUTPUT_NAME reverse_string)
add_executable(ex_count_to src/count_to.cpp)
add_dependencies(ex_count_to ${catkin_EXPORTED_TARGETS} ros_service_example_gencpp)
target_link_libraries(ex_count_to ${catkin_LIBRARIES})
set_target_properties(ex_count_to PROPERTIES OUTPUT_NAME count_to)