-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
72 lines (62 loc) · 2.5 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
###################################################################
# Cmake Build of GPS-Aided Inertial Navigation System #
###################################################################
# Project Setup
cmake_minimum_required(VERSION 3.22.0)
project(gps_aided_ins)
set(CMAKE_CXX_STANDARD 11)
# External Dependencies
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
include(FetchContent)
FetchContent_Declare(NavFuse
GIT_REPOSITORY git@github.com:ParkerBarrett959/NavFuse
GIT_TAG main)
FetchContent_MakeAvailable(NavFuse)
FetchContent_Declare(json
GIT_REPOSITORY git@github.com:nlohmann/json
GIT_TAG v3.11.2)
FetchContent_MakeAvailable(json)
# Add Header List
set(HEADER_LIST ${PROJECT_SOURCE_DIR}/include/compensatorThread.hpp
${PROJECT_SOURCE_DIR}/include/strapdownThread.hpp
${PROJECT_SOURCE_DIR}/include/kalmanFilterThread.hpp
${PROJECT_SOURCE_DIR}/include/util/jsonUtilities.hpp)
# Include Directories
include_directories(${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include/util)
# Add Executable
add_executable(GpsInsNavigation ${PROJECT_SOURCE_DIR}/src/main.cpp
${PROJECT_SOURCE_DIR}/src/compensatorThread.cpp
${PROJECT_SOURCE_DIR}/src/strapdownThread.cpp
${PROJECT_SOURCE_DIR}/src/kalmanFilterThread.cpp
${PROJECT_SOURCE_DIR}/src/util/jsonUtilities.cpp ${HEADER_LIST})
ament_target_dependencies(GpsInsNavigation rclcpp)
# Link Libraries
target_link_libraries(
GpsInsNavigation
navigation
nlohmann_json::nlohmann_json)
# Target Include Directories
target_include_directories(GpsInsNavigation PUBLIC ${PROJECT_SOURCE_DIR}/include
PUBLIC ${PROJECT_SOURCE_DIR}/include/util}
PUBLIC ${EIGEN_INSTALL_PATH})
# Unit Testing Build
enable_testing()
add_executable( test_gps_ins ${PROJECT_SOURCE_DIR}/test/testMain.cpp
${PROJECT_SOURCE_DIR}/test/jsonUtilitiesTest.cpp
${PROJECT_SOURCE_DIR}/src/util/jsonUtilities.cpp ${HEADER_LIST})
target_link_libraries(
test_gps_ins
GTest::gtest_main
navigation
nlohmann_json::nlohmann_json
)
# Target Include Directories
target_include_directories(test_gps_ins PUBLIC ${PROJECT_SOURCE_DIR}/include
PUBLIC ${PROJECT_SOURCE_DIR}/include/util
PUBLIC ${EIGEN_INSTALL_PATH})
include(GoogleTest)
gtest_discover_tests(test_gps_ins)