forked from SBG-Systems/sbg_ros2_driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
195 lines (164 loc) · 4.96 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
cmake_minimum_required(VERSION 3.5)
project(sbg_driver)
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_msgs REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(Boost REQUIRED)
find_package(sam_msgs REQUIRED)
################################################
## Declare ROS messages, services and actions ##
################################################
## Generate messages in the 'msg' folder
set (USED_LIBRARIES
rclcpp
sensor_msgs
std_msgs
std_srvs
geometry_msgs
nav_msgs
tf2_ros
tf2_msgs
tf2_geometry_msgs
)
set (msg_files
"msg/SbgGpsVelStatus.msg"
"msg/SbgGpsPosStatus.msg"
"msg/SbgMagStatus.msg"
"msg/SbgShipMotionStatus.msg"
"msg/SbgUtcTimeStatus.msg"
"msg/SbgAirData.msg"
"msg/SbgAirDataStatus.msg"
"msg/SbgEkfEuler.msg"
"msg/SbgGpsPos.msg"
"msg/SbgMag.msg"
"msg/SbgStatusCom.msg"
"msg/SbgEkfNav.msg"
"msg/SbgGpsRaw.msg"
"msg/SbgOdoVel.msg"
"msg/SbgStatusGeneral.msg"
"msg/SbgEkfQuat.msg"
"msg/SbgGpsVel.msg"
"msg/SbgStatus.msg"
"msg/SbgEvent.msg"
"msg/SbgImuStatus.msg"
"msg/SbgImuData.msg"
"msg/SbgImuShort.msg"
"msg/SbgShipMotion.msg"
"msg/SbgUtcTime.msg"
"msg/SbgGpsHdt.msg"
"msg/SbgMagCalib.msg"
"msg/SbgStatusAiding.msg"
"msg/SbgEkfStatus.msg"
)
rosidl_generate_interfaces(${PROJECT_NAME}
${msg_files}
DEPENDENCIES
std_msgs
geometry_msgs
builtin_interfaces
)
ament_export_dependencies(rosidl_default_runtime)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
add_subdirectory(external/sbgECom)
include_directories(
#${catkin_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/include/sbg_driver/
${PROJECT_SOURCE_DIR}/external/sbgECom/common
${PROJECT_SOURCE_DIR}/external/sbgECom/src
)
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(sbg ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Define common resources.
set (SBG_COMMON_RESOURCES
src/config_applier.cpp
src/message_publisher.cpp
src/message_wrapper.cpp
src/config_store.cpp
src/sbg_device.cpp
)
## Declare a C++ executable
add_executable(sbg_device ${SBG_COMMON_RESOURCES} src/main.cpp)
add_dependencies(sbg_device ${PROJECT_NAME})
target_compile_options(sbg_device PRIVATE -Wall -Wextra)
add_executable(sbg_device_mag ${SBG_COMMON_RESOURCES} src/main_mag.cpp)
add_dependencies(sbg_device_mag ${PROJECT_NAME})
target_compile_options(sbg_device_mag PRIVATE -Wall -Wextra)
## Specify libraries to link a library or executable target against
target_link_libraries(sbg_device ${catkin_LIBRARIES} sbgECom)
target_link_libraries(sbg_device_mag ${catkin_LIBRARIES} sbgECom)
ament_target_dependencies(sbg_device ${USED_LIBRARIES})
ament_target_dependencies(sbg_device_mag ${USED_LIBRARIES})
rosidl_get_typesupport_target(cpp_typesupport_target "${PROJECT_NAME}" "rosidl_typesupport_cpp")
target_link_libraries(sbg_device "${cpp_typesupport_target}")
target_link_libraries(sbg_device_mag "${cpp_typesupport_target}")
set_property(TARGET sbg_device PROPERTY CXX_STANDARD 14)
set_property(TARGET sbg_device_mag PROPERTY CXX_STANDARD 14)
# Install Python modules
ament_python_install_package(scripts)
# Install Python executables
install(PROGRAMS
scripts/sbg_to_ros.py
DESTINATION lib/${PROJECT_NAME}
)
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executables and/or libraries for installation
install(TARGETS sbg_device sbg_device_mag
DESTINATION lib/${PROJECT_NAME}
)
## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION include/${PROJECT_NAME} #${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
PATTERN ".git" EXCLUDE
)
# Mark other files for installation (e.g. launch and bag files, etc.)
install(DIRECTORY launch/
DESTINATION share/${PROJECT_NAME}/launch
PATTERN ".git" EXCLUDE)
install(DIRECTORY config/
DESTINATION share/${PROJECT_NAME}/config
PATTERN ".git" EXCLUDE)
###################################
## catkin specific configuration ##
###################################
ament_export_dependencies(
rclcpp
sensor_msgs
std_msgs
std_srvs
geometry_msgs
nav_msgs
tf2_ros
tf2_msgs
tf2_geometry_msgs
rosidl_default_runtime
)
ament_export_include_directories(
include
)
ament_package()
#############
## Testing ##
#############