-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
111 lines (95 loc) · 2.25 KB
/
CMakeLists.txt
File metadata and controls
111 lines (95 loc) · 2.25 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
cmake_minimum_required(VERSION 3.10.0)
project(state_estimation)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Eigen3 REQUIRED)
option(DEBUG_STATE_ESTIMATION "Print debug logs" OFF)
if(DEBUG_STATE_ESTIMATION)
add_definitions(-DDEBUG_STATE_ESTIMATION)
endif()
option(STATE_ESTIMATION_BUILD_GTEST "Build google test library for unit tests" OFF)
include_directories(
${EIGEN3_INCLUDE_DIRS}
include
)
###########
## Build ##
###########
file(GLOB SOURCE_FILES
src/definitions/*.cpp
src/filters/*.cpp
src/measurement_models/*.cpp
src/system_models/*.cpp
src/utilities/*.cpp
)
add_library(state_estimation
${SOURCE_FILES}
)
target_include_directories(state_estimation
PUBLIC
include
test/utilities
)
add_executable(six_d_rates_example
examples/six_d_rates_example.cpp
examples/data_io.cpp
)
target_link_libraries(six_d_rates_example
state_estimation
)
# Install the state estimation library and header files
install(TARGETS
state_estimation
six_d_rates_example
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)
install(DIRECTORY
include/state_estimation
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
)
#############
## Testing ##
#############
include(CTest)
if(BUILD_TESTING MATCHES ON)
# Try to get GTest
find_package(GTest)
if(NOT GTest_FOUND)
if(STATE_ESTIMATION_BUILD_GTEST MATCHES ON)
message("-- Will build gtest from /usr/src/googletest")
add_subdirectory(/usr/src/googletest gtest)
endif()
endif()
# Define all the tests we want to build, the loop below will create them all
set(TEST_TARGETS
angle_utilities
transformation_utilities
imu_utilities
integration
filter_base
kalman_filter
kalman_filter_vs
ekf
ekf_vs
ukf
ukf_vs
six_d_rates_imu_meas_model
six_d_rates_odom_meas_model
six_d_rates_system_model
)
foreach(target ${TEST_TARGETS})
add_executable(test_se_${target} test/test_${target}.cpp)
target_link_libraries(test_se_${target}
gtest
gtest_main
pthread
state_estimation
)
target_include_directories(test_se_${target}
PUBLIC
test/utilities
)
gtest_discover_tests(test_se_${target})
endforeach()
endif()