-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (53 loc) · 1.29 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
cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
## Find catkin and any catkin packages
find_package(
catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
genmsg
tf
)
## Declare ROS messages and services
add_service_files(
FILES
modifyMessage.srv
)
## Generate added messages and services
generate_messages(
DEPENDENCIES
std_msgs
)
## Declare a catkin package
catkin_package()
## Build talker and listener
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker beginner_tutorials_gencpp)
add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
add_dependencies(listener beginner_tutorials_gencpp)
## Enable catkin test and add files for the same
if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage")
add_rostest_gtest(
modifyMessageTest
test/modifyMessageTest.launch
test/modifyMessageTest.cpp
)
target_link_libraries(
modifyMessageTest
${catkin_LIBRARIES}
)
add_dependencies(
modifyMessageTest
talker
listener
${catkin_EXPORTED_TARGETS}
)
endif()