/
CMakeLists.txt
116 lines (107 loc) · 2.8 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
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
# SYSTEM because we don't want warnings for gtest headers.
include_directories(
SYSTEM ${PROJECT_SOURCE_DIR}/third_party/gtest/googletest/include
SYSTEM ${PROJECT_SOURCE_DIR}/third_party/gtest/googlemock/include
SYSTEM ${PROJECT_SOURCE_DIR}/third_party/mavlink/include
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTESTING")
if(MSVC)
add_compile_options(
/wd4996 # ignore deprecated
)
else()
add_compile_options(
-Wno-error=deprecated-declarations
)
endif()
# `make test` does not show output, but `make check` does
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose)
# This includes all GTests that run integration tests
add_executable(integration_tests_runner
../core/unittests_main.cpp
action_hover_async.cpp
action_hover_sync.cpp
action_takeoff_and_kill.cpp
action_transition_multicopter_fixedwing.cpp
action_goto.cpp
calibration.cpp
camera_mode.cpp
camera_settings.cpp
camera_status.cpp
camera_take_photo.cpp
camera_take_photo_interval.cpp
camera_format.cpp
camera_test_helpers.cpp
camera_test_helpers.h
CMakeLists.txt
follow_me.cpp
geofence_inclusion.cpp
gimbal.cpp
info.cpp
offboard_attitude.cpp
#logging.cpp # Not fully implemented
log_files.cpp
ftp.cpp
mission_cancellation.cpp
mission_change_speed.cpp
mission.cpp
mission_rtl.cpp
mission_raw_mission_changed.cpp
mission_set_current.cpp
offboard_velocity.cpp
offboard_position.cpp
param.cpp
path_checker.cpp
path_checker.h
system_connection_async.cpp
system_multi_components.cpp
telemetry_async.cpp
telemetry_health.cpp
telemetry_modes.cpp
telemetry_sync.cpp
mavlink_passthrough.cpp
mission_transfer_lossy.cpp
)
include_directories(
${PROJECT_SOURCE_DIR}/core
${PROJECT_SOURCE_DIR}
)
set_target_properties(integration_tests_runner
PROPERTIES COMPILE_FLAGS ${warnings}
)
target_link_libraries(integration_tests_runner
mavsdk
mavsdk_telemetry
mavsdk_action
mavsdk_mission
mavsdk_mission_raw
mavsdk_offboard
mavsdk_log_files
mavsdk_info
mavsdk_gimbal
mavsdk_follow_me
mavsdk_camera
mavsdk_calibration
mavsdk_geofence
mavsdk_param
mavsdk_ftp
mavsdk_mavlink_passthrough
gtest
gtest_main
gmock
)
add_test(integration_tests
integration_tests_runner
)
add_custom_command(TARGET integration_tests_runner
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/../../tools/start_px4_sitl.sh
${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET integration_tests_runner
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/../../tools/stop_px4_sitl.sh
${CMAKE_CURRENT_BINARY_DIR}
)