forked from superjax/UBLOX_read
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
99 lines (83 loc) · 2.39 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
cmake_minimum_required(VERSION 2.8.3)
project(ublox)
set(CMAKE_CXX_FLAGS "-std=c++17")
set(Boost_DEBUG ON)
set(Boost_DETAILED_FAILURE_MSG ON)
find_package(Eigen3 REQUIRED)
find_package(async_comm QUIET)
#find_package(Boost)
if (NOT ${async_comm_FOUND})
add_subdirectory(lib/async_comm)
set(async_comm_LIBRARIES async_comm)
set(async_comm_INCLUDE_DIRS lib/async_comm/include)
endif()
message("async_comm_INCLUDE_DIRS: ${async_comm_INCLUDE_DIRS}\n")
add_library(UBLOX
src/ublox.cpp
src/parsers/ubx_maps.cpp
src/parsers/ubx.cpp
src/parsers/rtcm.cpp
src/parsers/nav.cpp
src/utctime.cpp
)
message("UBLOX Boost include dirs: ${Boost_INCLUDE_DIRS}")
target_link_libraries(UBLOX ${async_comm_LIBRARIES} ${gnss_utils_LIBRARIES})
target_include_directories(UBLOX PUBLIC include ${async_comm_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS})
option(BUILD_TESTS "Build Tests" ON)
if (${BUILD_TESTS})
message(STATUS "Building UBLOX parser Tests")
find_package(GTest REQUIRED)
find_package(Threads REQUIRED)
add_executable(ublox_test
src/test/test_rtcm.cpp
src/test/test_time.cpp
src/test/test_eph.cpp)
target_link_libraries(ublox_test gtest gtest_main pthread UBLOX)
endif()
option(BUILD_EXAMPLES "Build Examples" ON)
if (${BUILD_EXAMPLES})
add_executable(base src/examples/base.cpp)
target_link_libraries(base UBLOX)
add_executable(rover src/examples/rover.cpp)
target_link_libraries(rover UBLOX)
add_executable(read src/examples/read.cpp)
target_link_libraries(read UBLOX)
endif()
option(BUILD_ROS "Build ROS Node" ON)
if (${BUILD_ROS})
message(STATUS "BUILDING UBLOX ROS PACKAGE")
find_package(catkin REQUIRED COMPONENTS
rosbag
roscpp
sensor_msgs
message_generation)
add_message_files(
DIRECTORY msg
FILES
PosVelEcef.msg
PositionVelocityTime.msg
RelPos.msg
SurveyStatus.msg
Ephemeris.msg
GlonassEphemeris.msg
Observation.msg
ObsVec.msg)
add_service_files(
DIRECTORY srv
FILES
CfgValGet.srv
CfgValDel.srv
CfgValSet.srv)
generate_messages(
DEPENDENCIES
std_msgs)
catkin_package(
LIBRARIES UBLOX
INCLUDE_DIRS include
CATKIN_DEPENDS std_msgs message_runtime
)
add_executable(ublox_ros src/ros/ublox_ros.cpp)
target_link_libraries(ublox_ros UBLOX ${catkin_LIBRARIES})
target_include_directories(ublox_ros PUBLIC ../../devel/include ${catkin_INCLUDE_DIRS})
add_dependencies(ublox_ros ${catkin_EXPORTED_TARGETS})
endif()