-
Notifications
You must be signed in to change notification settings - Fork 46
/
CMakeLists.txt
208 lines (182 loc) · 5.11 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
196
197
198
199
200
201
202
203
204
205
206
207
208
cmake_minimum_required(VERSION 2.8.3)
project(nlink_parser)
# # Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
add_definitions(-std=c++11)
# # Find catkin macros and libraries
# # if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
# # is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
message_generation
)
add_subdirectory(extern/serial)
include_directories(extern/serial/include)
# find_package(serial CONFIG REQUIRED)
# # Generate messages in the 'msg' folder
add_message_files(
FILES
LinktrackAnchorframe0.msg
LinktrackNode0.msg
LinktrackNode1.msg
LinktrackNode2.msg
LinktrackNodeframe0.msg
LinktrackNodeframe1.msg
LinktrackNodeframe2.msg
LinktrackNodeframe3.msg
LinktrackTag.msg
LinktrackTagframe0.msg
TofsenseCascade.msg
TofsenseFrame0.msg
LinktrackAoaNode0.msg
LinktrackAoaNodeframe0.msg
LinktrackNode4Anchor.msg
LinktrackNode4Tag.msg
LinktrackNodeframe4.msg
LinktrackNode5.msg
LinktrackNodeframe5.msg
LinktrackNode6.msg
LinktrackNodeframe6.msg
TofsenseMFrame0.msg
TofsenseMFrame0Pixel.msg
IotFrame0.msg
IotFrame0Node.msg
)
# # Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )
# # Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
# # Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES nlink
CATKIN_DEPENDS message_runtime
# DEPENDS system_lib
)
# ##########
# # Build ##
# ##########
# # Specify additional locations of header files
# # Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
src/utils
)
set(nutils "nutils")
add_library(${nutils}
src/utils/protocol_extracter/nprotocol_base.cpp
src/utils/protocol_extracter/nprotocol_extracter.cpp
src/utils/nlink_unpack/nlink_utils.c
src/utils/nlink_unpack/nlink_linktrack_anchorframe0.c
src/utils/nlink_unpack/nlink_linktrack_tagframe0.c
src/utils/nlink_unpack/nlink_linktrack_nodeframe0.c
src/utils/nlink_unpack/nlink_linktrack_nodeframe1.c
src/utils/nlink_unpack/nlink_linktrack_nodeframe2.c
src/utils/nlink_unpack/nlink_linktrack_nodeframe3.c
src/utils/nlink_unpack/nlink_linktrack_nodeframe4.c
src/utils/nlink_unpack/nlink_linktrack_nodeframe5.c
src/utils/nlink_unpack/nlink_linktrack_nodeframe6.c
src/utils/nlink_unpack/nlink_tofsense_frame0.c
src/utils/nlink_unpack/nlink_tofsensem_frame0.c
src/utils/nlink_unpack/nlink_linktrack_aoa_nodeframe0.c
src/utils/nlink_unpack/nlink_iot_frame0.c
src/utils/init_serial.cpp
src/utils/nlink_protocol.cpp
src/utils/nutils.cpp
)
target_link_libraries(${nutils}
${catkin_LIBRARIES}
serial
)
set(LINKTRACK_NAME "linktrack")
add_executable(${LINKTRACK_NAME}
src/linktrack/init.cpp
src/linktrack/main.cpp
src/linktrack/protocols.cpp
)
target_link_libraries(${LINKTRACK_NAME}
# ${catkin_LIBRARIES}
${nutils}
)
add_dependencies(${LINKTRACK_NAME} ${PROJECT_NAME}_generate_messages_cpp)
set(LINKTRACK_RVIZ_NAME "linktrack_rviz_converter")
add_executable(${LINKTRACK_RVIZ_NAME}
src/linktrack/main_rviz_converter.cpp
)
target_link_libraries(${LINKTRACK_RVIZ_NAME}
${nutils}
)
add_dependencies(${LINKTRACK_RVIZ_NAME} ${PROJECT_NAME}_generate_messages_cpp)
set(TOFSENSE_NAME "tofsense")
add_executable(${TOFSENSE_NAME}
src/tofsense/init.cpp
src/tofsense/main.cpp
)
target_link_libraries(${TOFSENSE_NAME}
# ${catkin_LIBRARIES}
${nutils}
)
add_dependencies(${TOFSENSE_NAME} ${PROJECT_NAME}_generate_messages_cpp)
set(EXE_NAME "tofsensem")
add_executable(${EXE_NAME}
src/tofsensem/init.cpp
src/tofsensem/main.cpp
)
target_link_libraries(${EXE_NAME}
${nutils}
)
add_dependencies(${EXE_NAME} ${PROJECT_NAME}_generate_messages_cpp)
set(EXE_NAME "linktrack_aoa")
add_executable(${EXE_NAME}
src/linktrack_aoa/init.cpp
src/linktrack_aoa/main.cpp
src/linktrack/protocols.cpp
)
target_link_libraries(${EXE_NAME}
# ${catkin_LIBRARIES}
${nutils}
)
add_dependencies(${EXE_NAME} ${PROJECT_NAME}_generate_messages_cpp)
set(EXE_NAME "iot")
add_executable(${EXE_NAME}
src/iot/init.cpp
src/iot/main.cpp
)
target_link_libraries(${EXE_NAME}
${nutils}
)
add_dependencies(${EXE_NAME} ${PROJECT_NAME}_generate_messages_cpp)
# ############
# # Testing ##
# ############
if(${CATKIN_ENABLE_TESTING})
find_package(rostest REQUIRED)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
# # Add gtest based cpp test target and link libraries
catkin_add_gtest(${PROJECT_NAME}_test
src/linktrack/init.cpp
src/linktrack/protocols.cpp
src/tofsense/init.cpp
src/linktrack_aoa/init.cpp
test/test_nlink_parser.cpp
src/tofsensem/init.cpp
src/iot/init.cpp
)
endif()
if(TARGET ${PROJECT_NAME}_test)
target_link_libraries(${PROJECT_NAME}_test ${nutils})
endif()