-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
100 lines (74 loc) · 1.58 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
cmake_minimum_required(VERSION 3.8)
project(cart)
# Default to C11
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
endif()
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(NOT WIN32)
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# Common Packages
find_package(control_msgs REQUIRED)
find_package(std_msgs REQUIRED)
# C++ packages
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
# Python packages
find_package(ament_cmake_python REQUIRED)
find_package(rclpy REQUIRED)
include_directories(include)
install(DIRECTORY
config
launch
scripts
xacro
DESTINATION share/${PROJECT_NAME}/
)
# C++ Executables
add_executable(position src/position.cpp)
ament_target_dependencies( position
rclcpp
rclcpp_action
control_msgs
)
add_executable(velocity src/velocity.cpp)
ament_target_dependencies( velocity
rclcpp
std_msgs
)
add_executable(effort src/effort.cpp)
ament_target_dependencies( effort
rclcpp
std_msgs
)
add_executable(cpp_node src/cpp_node.cpp)
ament_target_dependencies( cpp_node
rclcpp
)
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
# Install C++ Modules
install(TARGETS
position
velocity
effort
cpp_node
DESTINATION lib/${PROJECT_NAME}
)
# Install Python Modules
ament_python_install_package(${PROJECT_NAME})
install(PROGRAMS
scripts/py_node.py
scripts/effort.py
scripts/velocity.py
DESTINATION lib/${PROJECT_NAME}
)
ament_package()