-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
80 lines (74 loc) · 1.75 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
cmake_minimum_required(VERSION 3.14)
project(simGCS VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#
# CMake for the simGCS target, which is a GCS with a built in a UAS simulation.
# Tested on Linux and Android Emulator.
#
find_package(Qt5 REQUIRED COMPONENTS
Core
Quick
QuickControls2
Location
)
set(APP_HEADERS
inc/TelemetrySimulator.hpp
inc/QFlightMode.hpp
)
set(APP_SOURCES
qml/qml.qrc
src/main.cpp
src/TelemetrySimulator.cpp
)
set(APP_LIBRARIES
Qt5::Core
Qt5::Quick
Qt5::QuickControls2
Qt5::Location
)
if(ANDROID)
add_library(simGCS SHARED
${APP_HEADERS}
${APP_SOURCES}
)
else()
add_executable(simGCS
${APP_HEADERS}
${APP_SOURCES}
)
endif()
target_link_libraries(simGCS PRIVATE ${APP_LIBRARIES} )
target_include_directories(simGCS PRIVATE inc)
if(NOT ANDROID)
#
# Setup GoogleTest
#
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
)
FetchContent_MakeAvailable(googletest)
enable_testing()
include_directories(${googletest_SOURCE_DIR}/include ${googletest_SOURCE_DIR})
include(GoogleTest)
#
# add telemetry_simulator_tests
#
add_executable(telemetry_simulator_tests
test/TelemetrySimulatorTests.cpp
${APP_HEADERS}
src/TelemetrySimulator.cpp
)
target_include_directories(telemetry_simulator_tests PRIVATE inc)
target_link_libraries(telemetry_simulator_tests
gtest
${APP_LIBRARIES}
)
gtest_discover_tests(telemetry_simulator_tests)
endif()