-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
142 lines (119 loc) · 2.91 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
project(pacmod3_msgs)
find_package(ros_environment REQUIRED)
set(ROS_VERSION $ENV{ROS_VERSION})
set(MSG_FILES
"AccelAuxRpt.msg"
"AllSystemStatuses.msg"
"AngVelRpt.msg"
"BrakeAuxRpt.msg"
"BrakeDecelAuxRpt.msg"
"BrakeDecelCmd.msg"
"CabinClimateCmd.msg"
"CabinClimateRpt.msg"
"ComponentRpt.msg"
"DateTimeRpt.msg"
"DetectedObjectRpt.msg"
"DoorRpt.msg"
"DriveTrainFeatureRpt.msg"
"EngineRpt.msg"
"EStopRpt.msg"
"GlobalCmd.msg"
"GlobalRpt2.msg"
"GlobalRpt.msg"
"HeadlightAuxRpt.msg"
"InteriorLightsRpt.msg"
"KeyValuePair.msg"
"LatLonHeadingRpt.msg"
"LinearAccelRpt.msg"
"MotorRpt1.msg"
"MotorRpt2.msg"
"MotorRpt3.msg"
"NotificationCmd.msg"
"OccupancyRpt.msg"
"ParkingBrakeAuxRpt.msg"
"RearLightsRpt.msg"
"SafetyBrakeCmd.msg"
"SafetyBrakeRpt.msg"
"SafetyFuncCmd.msg"
"SafetyFuncCriticalStopRpt.msg"
"SafetyFuncRpt.msg"
"ShiftAuxRpt.msg"
"SoftwareVersionRpt.msg"
"SteeringAuxRpt.msg"
"SteeringCmdLimitRpt.msg"
"SteeringCmd.msg"
"SupervisoryCtrl.msg"
"SystemCmdBool.msg"
"SystemCmdFloat.msg"
"SystemCmdInt.msg"
"SystemCmdLimitRpt.msg"
"SystemRptBool.msg"
"SystemRptFloat.msg"
"SystemRptInt.msg"
"TirePressureRpt.msg"
"TurnAuxRpt.msg"
"VehicleDynamicsRpt.msg"
"VehicleSpeedRpt.msg"
"VinRpt.msg"
"WatchdogRpt2.msg"
"WatchdogRpt.msg"
"WheelSpeedRpt.msg"
"WiperAuxRpt.msg"
"YawRateRpt.msg"
)
if(${ROS_VERSION} EQUAL 1)
cmake_minimum_required(VERSION 2.8.3)
# Default to C++11
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
find_package(catkin REQUIRED
COMPONENTS
message_generation
std_msgs
)
add_message_files(FILES
${MSG_FILES}
DIRECTORY msg
)
generate_messages(DEPENDENCIES std_msgs)
catkin_package(
CATKIN_DEPENDS message_runtime
)
# install(DIRECTORY migration
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/
# )
elseif(${ROS_VERSION} EQUAL 2)
cmake_minimum_required(VERSION 3.5)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
find_package(ament_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(std_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
# Apend "msg/" to each file name
set(TEMP_LIST "")
foreach(MSG_FILE ${MSG_FILES})
list(APPEND TEMP_LIST "msg/${MSG_FILE}")
endforeach()
set(MSG_FILES ${TEMP_LIST})
rosidl_generate_interfaces(${PROJECT_NAME}
${MSG_FILES}
DEPENDENCIES builtin_interfaces std_msgs
ADD_LINTER_TESTS
)
ament_export_dependencies(rosidl_default_runtime)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
# install(DIRECTORY migration
# DESTINATION share/${PROJECT_NAME}/
# )
ament_package()
endif()