forked from RichardKelley/gnss_driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
134 lines (115 loc) · 3.73 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
cmake_minimum_required(VERSION 2.8.3)
project(gnss_driver)
#add_compile_options(-std=c++11)
find_package(catkin REQUIRED COMPONENTS
nodelet
roscpp
std_msgs
message_generation
)
find_package(Boost REQUIRED COMPONENTS system)
add_message_files(
FILES
Gnss.msg
Gps.msg
Point2D.msg
Pose.msg
GnssRange.msg
Imu.msg
Point3D.msg
Quaternion.msg
GnssStatus.msg
Ins.msg
PointENU.msg
RangeInfo.msg
GPGGA.msg
InsStatus.msg
PointLLH.msg
StreamStatus.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
LIBRARIES ${catkin_LIBRARIES} roscpp
CATKIN_DEPENDS roscpp std_msgs message_runtime
DEPENDS protobuf
)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-g -pipe -W -Wall -Wno-sign-compare -Wno-unused-parameter -fPIC -O2 -Wno-parentheses -rdynamic -std=c++11")
endif()
find_package(Proj)
IF (DEFINED PROTOBUF_LIBRARIES)
MESSAGE(STATUS "proto: " ${PROTOBUF_LIBRARIES})
ELSE()
set(PROTOBUF_LIBRARIES "protobuf")
MESSAGE(STATUS "proto: " ${PROTOBUF_LIBRARIES})
ENDIF (defined PROTOBUF_LIBRARIES)
include_directories(include)
include_directories(${catkin_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR})
link_directories(lib)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories("${PROJECT_SOURCE_DIR}/proto")
SET(ERROR_CODE_SRCS "${PROJECT_SOURCE_DIR}/proto/error_code.pb.cc")
SET(HEADER_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/header.pb.cc")
SET(GEOMETRY_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/geometry.pb.cc")
SET(LOCALIZATION_POSE_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/pose.pb.cc")
SET(LOCALIZATION_GPS_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/gps.pb.cc")
SET(LOCALIZATION_IMU_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/imu.pb.cc")
SET(GNSS_STATUS_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/gnss_status.pb.cc")
SET(CONFIG_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/config.pb.cc")
SET(GPGGA_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/gpgga.pb.cc")
SET(GNSS_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/gnss.pb.cc")
SET(IMU_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/imu.pb.cc")
SET(INS_PB_SRCS "${PROJECT_SOURCE_DIR}/proto/ins.pb.cc")
add_library(utils
src/impl/utils.cpp
${CONFIG_PB_SRCS}
${GPGGA_PB_SRCS}
${GNSS_PB_SRCS}
${IMU_PB_SRCS}
${INS_PB_SRCS}
${GNSS_STATUS_PB_SRCS}
${LOCALIZATION_POSE_PB_SRCS}
${LOCALIZATION_IMU_PB_SRCS}
${LOCALIZATION_GPS_PB_SRCS}
${HEADER_PB_SRCS}
${ERROR_CODE_SRCS}
${GEOMETRY_PB_SRCS})
target_link_libraries(utils ${catkin_LIBRARIES} ${PROTOBUF_LIBRARIES})
add_library(stream_nodelet
src/stream_nodelet.cpp
src/raw_stream.cpp
src/impl/serial_stream.cpp
src/impl/tcp_stream.cpp
src/impl/udp_stream.cpp
src/impl/ntrip_stream.cpp)
target_link_libraries(stream_nodelet utils ${catkin_LIBRARIES} ${PROTOBUF_LIBRARIES})
add_library(parser_nodelet
src/parser_nodelet.cpp
src/data_parser.cpp
src/impl/novatel_parser.cpp)
add_dependencies(parser_nodelet novatel_msgs_generate_messages_cpp)
target_link_libraries(parser_nodelet utils ${catkin_LIBRARIES} ${PROTOBUF_LIBRARIES} proj)
add_executable(parser_cli
tests/parser_cli.cpp
src/impl/novatel_parser.cpp)
target_link_libraries(parser_cli utils ${catkin_LIBRARIES} ${PROTOBUF_LIBRARIES})
add_executable(test_monitor
tests/test_monitor.cpp)
target_link_libraries(test_monitor utils ${catkin_LIBRARIES} ${PROTOBUF_LIBRARIES})
install(
TARGETS stream_nodelet parser_nodelet utils test_monitor parser_cli
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(FILES nodelets.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch)
install(DIRECTORY conf/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/conf)