-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
63 lines (45 loc) · 2.45 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
cmake_minimum_required(VERSION 3.15)
include(FetchContent)
project(Sim6DOF VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_BUILD_TYPE Debug)
#add_definitions("-Wall -Wextra -O0")
file(GLOB_RECURSE src ./src/*.cc)
add_executable(6dof ${src})
add_library(6dof_lib ${src})
configure_file(${PROJECT_SOURCE_DIR}/src/Sim6DOFInfo.h.in ${PROJECT_SOURCE_DIR}/src/Sim6DOFInfo.h)
target_include_directories(6dof PUBLIC
${PROJECT_BINARY_DIR}
)
add_definitions( -DCURL_STATICLIB )
# Eigen Headers
include_directories(PUBLIC "/usr/local/Cellar/eigen/3.4.0/include/eigen3/")
# MAVLink headers
target_include_directories(6dof PUBLIC ${CMAKE_SOURCE_DIR}/mavlink/standard/)
target_include_directories(6dof_lib PUBLIC ${CMAKE_SOURCE_DIR}/mavlink/standard/)
find_package(Boost COMPONENTS thread chrono REQUIRED)
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(6dof PUBLIC Eigen3::Eigen ${Boost_LIBRARIES} curl)
# Vertical Takeoff Example
file(GLOB_RECURSE vertical_takeoff_example Examples/vertical_takeoff_example.cc)
add_executable(vertical_takeoff_example ${vertical_takeoff_example})
target_include_directories(vertical_takeoff_example PUBLIC ${CMAKE_SOURCE_DIR}/mavlink/standard/)
target_link_libraries(vertical_takeoff_example PUBLIC 6dof_lib Eigen3::Eigen ${Boost_LIBRARIES} curl)
# Manoeuvre plan Example
file(GLOB_RECURSE manouvre_plan_example Examples/manouvre_plan_example.cc)
add_executable(manouvre_plan_example ${manouvre_plan_example})
target_include_directories(manouvre_plan_example PUBLIC ${CMAKE_SOURCE_DIR}/mavlink/standard/)
target_link_libraries(manouvre_plan_example PUBLIC 6dof_lib Eigen3::Eigen ${Boost_LIBRARIES} curl)
# RPY Manoeuvre Example
file(GLOB_RECURSE rpy_maneuvers Examples/rpy_maneuvers.cc)
add_executable(rpy_maneuvers ${rpy_maneuvers})
target_include_directories(rpy_maneuvers PUBLIC ${CMAKE_SOURCE_DIR}/mavlink/standard/)
target_link_libraries(rpy_maneuvers PUBLIC 6dof_lib Eigen3::Eigen ${Boost_LIBRARIES} curl)
# Compass calibration sequence
file(GLOB_RECURSE rpy_maneuvers Examples/calibrate_compass.cc)
add_executable(compass_calibration ${rpy_maneuvers})
target_include_directories(compass_calibration PUBLIC ${CMAKE_SOURCE_DIR}/mavlink/standard/)
target_link_libraries(compass_calibration PUBLIC 6dof_lib Eigen3::Eigen ${Boost_LIBRARIES} curl)
file(COPY "Resources/WMM.COF" DESTINATION ${CMAKE_BINARY_DIR})