-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (38 loc) · 824 Bytes
/
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
cmake_minimum_required(VERSION 3.8)
project(cpp_publisher_subscriber)
find_package(ament_cmake REQUIRED)
set(ROS2_REQUIRED_COMPONENTS
rclcpp
std_msgs
)
foreach(COMPONENT ${ROS2_REQUIRED_COMPONENTS})
find_package(${COMPONENT} REQUIRED)
endforeach()
add_executable(
subscriber
${CMAKE_CURRENT_LIST_DIR}/src/subscriber.cpp
)
ament_target_dependencies(
subscriber
${ROS2_REQUIRED_COMPONENTS}
)
add_executable(
publisher
${CMAKE_CURRENT_LIST_DIR}/src/publisher.cpp
)
ament_target_dependencies(
publisher
${ROS2_REQUIRED_COMPONENTS}
)
install(
TARGETS subscriber publisher
DESTINATION lib/${PROJECT_NAME}
)
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
ament_add_gtest(
unit_testing
src/unit_tests.cpp
)
endif()
ament_package()