-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
99 lines (84 loc) · 2.45 KB
/
Copy pathCMakeLists.txt
File metadata and controls
99 lines (84 loc) · 2.45 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
cmake_minimum_required(VERSION 3.10)
project(mars_control)
# C++17 required for std::filesystem
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclpy REQUIRED)
find_package(rclcpp REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(mars_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(brain_messages REQUIRED)
find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(yaml-cpp REQUIRED)
# ============================================================================
# C++ Executable: app.cpp
# ============================================================================
add_executable(app.cpp mars_control/app.cpp mars_control/drive_smoother.cpp)
target_link_libraries(app.cpp
nlohmann_json::nlohmann_json
yaml-cpp
)
ament_target_dependencies(app.cpp
rclcpp
geometry_msgs
nav_msgs
brain_messages
std_msgs
std_srvs
sensor_msgs
mars_msgs
)
# ============================================================================
# C++ Executable: udp_leader_receiver.cpp
# ============================================================================
add_executable(udp_leader_receiver mars_control/udp_leader_receiver.cpp)
ament_target_dependencies(udp_leader_receiver
rclcpp
sensor_msgs
std_srvs
)
install(TARGETS
app.cpp
udp_leader_receiver
DESTINATION lib/${PROJECT_NAME}
)
# ============================================================================
# Python modules and executables
# ============================================================================
# Install Python modules
ament_python_install_package(${PROJECT_NAME})
# Install Python executables
install(PROGRAMS
mars_control/keyboard.py
mars_control/joystick.py
mars_control/leader.py
mars_control/motor_sound.py
DESTINATION lib/${PROJECT_NAME}
)
# Install launch files
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}
)
# Install config files
install(DIRECTORY
config
DESTINATION share/${PROJECT_NAME}
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()