-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
146 lines (130 loc) · 4.9 KB
/
CMakeLists.txt
File metadata and controls
146 lines (130 loc) · 4.9 KB
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
cmake_minimum_required(VERSION 3.6)
project(olp)
# Set a default build type if none was specified
set(DEFAULT_BUILD_TYPE "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# CMake module directory (for FindPCAP)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
# SLAM support (not Windows compatible)
option(WITH_SLAM "Build SLAM algorithms" ON) # Enabled by default
if(WITH_SLAM)
add_definitions(-DWITH_SLAM)
message(STATUS "Building with SLAM support")
else()
message(STATUS "Building without SLAM support")
endif()
# Set Visual Studio startUp project
# (Requires CMake 3.6.0 RC1 or later)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT "olp")
# Thread
find_package(Threads REQUIRED)
# Boost
find_package(Boost 1.60 REQUIRED filesystem log program_options system thread)
include_directories(${Boost_INCLUDE_DIR})
link_libraries(${Boost_LIBRARIES})
# PCL
# (BOOST_INCLUDEDIR required if not on default Linux location /usr/include)
set(BOOST_INCLUDEDIR ${Boost_INCLUDE_DIR})
find_package(PCL 1.8 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
add_definitions(${PCL_DEFINITIONS})
link_directories(${PCL_LIBRARY_DIRS})
# PCAP
find_package(PCAP)
# LAStools
find_package(LASlib PATHS vendor/LAStools/install)
if(LASlib_FOUND)
set(LASlib_LIBRARY_DIRS ${LASlib_INCLUDE_DIRS}/../../lib/LASlib/)
set(LASlib_LIBRARIES LASlib)
else()
if(MSVC AND EXISTS ${CMAKE_SOURCE_DIR}/vendor/LAStools/install/include)
set(LASlib_FOUND true)
set(LASlib_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/vendor/LAStools/install/include/LASlib)
set(LASlib_LIBRARY_DIRS ${CMAKE_SOURCE_DIR}/vendor/LAStools/install/lib/LASlib/Release)
set(LASlib_LIBRARIES LASlib)
message(STATUS "LASlib found by manual lookup")
endif()
endif()
if(NOT LASlib_FOUND)
message(SEND_ERROR "LASlib not found")
endif()
include_directories(${LASlib_INCLUDE_DIRS})
link_directories(${LASlib_LIBRARY_DIRS})
# libpointmatcher
find_package(libnabo REQUIRED PATHS vendor/libnabo/install)
find_package(libpointmatcher REQUIRED PATHS vendor/libpointmatcher/install)
include_directories(${libpointmatcher_INCLUDE_DIRS})
# ikalman
include_directories(vendor/ikalman)
add_library(ikalman
vendor/ikalman/kalman.c vendor/ikalman/kalman.h
vendor/ikalman/matrix.c vendor/ikalman/matrix.h
vendor/ikalman/gps.c vendor/ikalman/gps.h compute/IMU/FusionAHRS/FusionFilter.hpp)
# TinyEKF
include_directories(vendor/TinyEKF/src)
add_library(tinyekf
vendor/TinyEKF/src/tiny_ekf.c)
# Targets
add_executable(olp
main.cpp
viewer.hpp
helpers/LASHelper.cpp helpers/LASHelper.h
helpers/FileHelper.cpp helpers/FileHelper.h
helpers/GPSHelper.cpp helpers/GPSHelper.h
helpers/KalmanHelper.cpp helpers/KalmanHelper.h
helpers/TinyEKFHelper.cpp helpers/TinyEKFHelper.h
helpers/CsvFileWriter.h
helpers/Utility.h
helpers/ViewerHelper.h
piping/ProcessorPipe.hpp
compute/Processor.h
compute/Producer.hpp
compute/Consumer.hpp
compute/Filter.hpp
compute/Transformer.hpp
compute/calculators/Calculator.h
compute/calculators/GPSCalculator.hpp
compute/calculators/GPSPacketCalculator.hpp
compute/calculators/ICPSLAMCalculator.hpp
compute/calculators/LOAMSLAMCalculator.hpp
compute/calculators/GPSExtrapolationStrategy/GPSExtrapolationStrategy.hpp
compute/calculators/GPSExtrapolationStrategy/EKFExtrapolationStrategy.hpp
compute/calculators/GPSExtrapolationStrategy/PoliExtrapolationStrategy.hpp
compute/IMUProcessor.hpp
compute/IMU/MadgwickAHRS/MadgwickAHRS.h compute/IMU/MadgwickAHRS/MadgwickAHRS.cpp
grabber/GPSPacket.h
grabber/GPSVLPGrabber.h grabber/GPSVLPGrabber.cpp
grabber/NmeaParser.h grabber/NmeaParser.cpp
compute/IMU/AHRSFilter.h compute/IMU/MadgwickAHRS/MadgwickFilter.hpp
compute/IMU/FusionAHRS/Fusion.h
compute/IMU/FusionAHRS/FusionAhrs.c
compute/IMU/FusionAHRS/FusionAhrs.h
compute/IMU/FusionAHRS/FusionBias.c
compute/IMU/FusionAHRS/FusionBias.h
compute/IMU/FusionAHRS/FusionCalibration.h
compute/IMU/FusionAHRS/FusionCompass.c
compute/IMU/FusionAHRS/FusionCompass.h
compute/IMU/FusionAHRS/FusionTypes.h
compute/IMU/FusionAHRS/FusionFilter.hpp
helpers/IMUHelper.h)
target_link_libraries(olp
${Boost_LIBRARIES}
${PCL_LIBRARIES}
${PCAP_LIBRARY}
${LASlib_LIBRARIES}
${libpointmatcher_LIBRARIES}
${libnabo_LIBRARIES}
ikalman
tinyekf)
install(TARGETS olp
DESTINATION ${CMAKE_INSTALL_PREFIX})