CMakeLists.txt
1.23 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
cmake_minimum_required(VERSION 3.5.1)
project(mavsdk_tests CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
file(READ MAVSDK_VERSION MAVSDK_VERSION)
string(STRIP ${MAVSDK_VERSION} MAVSDK_VERSION)
find_package(MAVSDK "${MAVSDK_VERSION}" REQUIRED)
find_package(Threads REQUIRED)
if(MAVSDK_FOUND)
add_executable(mavsdk_tests
test_main.cpp
autopilot_tester.cpp
test_multicopter_failsafe.cpp
test_multicopter_mission.cpp
test_multicopter_offboard.cpp
test_multicopter_manual.cpp
test_vtol_mission.cpp
)
target_link_libraries(mavsdk_tests
MAVSDK::mavsdk
MAVSDK::mavsdk_action
MAVSDK::mavsdk_failure
MAVSDK::mavsdk_info
MAVSDK::mavsdk_manual_control
MAVSDK::mavsdk_mission
MAVSDK::mavsdk_mission_raw
MAVSDK::mavsdk_offboard
MAVSDK::mavsdk_param
MAVSDK::mavsdk_telemetry
${CMAKE_THREAD_LIBS_INIT}
)
target_compile_options(mavsdk_tests
PRIVATE
-Wall
-Wextra
-Werror
-Wno-error=deprecated-declarations
)
else()
message("MAVSDK C++ not found, skipping mavsdk_tests build..")
endif()