-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
81 lines (65 loc) · 2.09 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
cmake_minimum_required(VERSION 3.8)
project(network_bridge)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# Set C++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(pluginlib REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)
find_package(PkgConfig REQUIRED)
pkg_check_modules(ZSTD REQUIRED libzstd)
if(BUILD_TESTING)
find_package(launch_testing_ament_cmake REQUIRED)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
add_launch_test(
test/test_udp.py
TIMEOUT 2 # Sets a timeout for the test in seconds
)
add_launch_test(
test/test_tcp.py
TIMEOUT 2 # Sets a timeout for the test in seconds
)
endif()
include_directories(include)
add_executable(network_bridge src/network_bridge.cpp src/subscription_manager.cpp)
add_library(udp_interface SHARED
src/network_interfaces/udp_interface.cpp
)
add_library(tcp_interface SHARED
src/network_interfaces/tcp_interface.cpp
)
ament_target_dependencies(network_bridge pluginlib rclcpp std_msgs)
ament_target_dependencies(udp_interface pluginlib rclcpp)
ament_target_dependencies(tcp_interface pluginlib rclcpp)
target_link_libraries(network_bridge ${ZSTD_LIBRARIES})
target_link_libraries(udp_interface ${Boost_LIBRARIES})
target_link_libraries(tcp_interface ${Boost_LIBRARIES})
pluginlib_export_plugin_description_file(network_bridge network_interface_plugins.xml)
install(TARGETS
network_bridge
DESTINATION lib/${PROJECT_NAME}
)
install(TARGETS
udp_interface
tcp_interface
DESTINATION lib/
)
install(DIRECTORY
config
launch
DESTINATION share/${PROJECT_NAME}
)
ament_package()