/
/
/
1cmake_minimum_required(VERSION 3.8)
2project(bag_recorder_backend)
3
4if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5 add_compile_options(-Wall -Wextra -Wpedantic)
6endif()
7
8# find dependencies
9find_package(ament_cmake REQUIRED)
10find_package(rclcpp REQUIRED)
11find_package(rosbag2_cpp REQUIRED)
12find_package(rosbag2_storage REQUIRED)
13find_package(rosbag2_storage_default_plugins REQUIRED)
14find_package(std_msgs REQUIRED)
15find_package(sensor_msgs REQUIRED)
16find_package(geometry_msgs REQUIRED)
17find_package(nav_msgs REQUIRED)
18find_package(tf2_msgs REQUIRED)
19
20# Find Crow framework and SSL support
21find_package(Crow REQUIRED)
22find_package(OpenSSL REQUIRED)
23
24# Enable SSL support for Crow
25set(CROW_ENABLE_SSL ON)
26add_compile_definitions(CROW_ENABLE_SSL)
27
28# Include directories
29include_directories(include)
30
31# Create executable
32add_executable(bag_recorder_node
33 src/main.cpp
34 src/bag_recorder_node.cpp
35 src/crow_server.cpp
36 src/websocket_manager.cpp
37)
38
39# Specify libraries to link a library or executable target against
40target_link_libraries(bag_recorder_node
41 Crow::Crow
42 OpenSSL::SSL
43 OpenSSL::Crypto
44 pthread
45)
46
47ament_target_dependencies(bag_recorder_node
48 rclcpp
49 rosbag2_cpp
50 rosbag2_storage
51 rosbag2_storage_default_plugins
52 std_msgs
53 sensor_msgs
54 geometry_msgs
55 nav_msgs
56 tf2_msgs
57)
58
59# Install targets
60install(TARGETS
61 bag_recorder_node
62 DESTINATION lib/${PROJECT_NAME}
63)
64
65# Install config files
66install(DIRECTORY
67 config/
68 DESTINATION share/${PROJECT_NAME}/config
69)
70
71if(BUILD_TESTING)
72 find_package(ament_lint_auto REQUIRED)
73 find_package(ament_cmake_gtest REQUIRED)
74
75 # the following line skips the linter which checks for copyrights
76 set(ament_cmake_copyright_FOUND TRUE)
77 # the following line skips cpplint (only works in a git repo)
78 set(ament_cmake_cpplint_FOUND TRUE)
79
80 ament_lint_auto_find_test_dependencies()
81endif()
82
83ament_package()