CMakeLists.txt 4.43 KB
Newer Older
1

2 3 4 5
include_directories(
	.
	${CMAKE_CURRENT_BINARY_DIR}
	${Qt5Location_PRIVATE_INCLUDE_DIRS}
6
	VideoManager
7 8 9 10 11 12 13
)

set(EXTRA_SRC)

if(MOBILE)
	list(APPEND EXTRA_SRC
		MobileScreenMgr.cc
14
		MobileScreenMgr.h
15 16
	)
endif()
17 18 19 20 21 22 23 24 25 26 27 28
if(GST_FOUND)
	# TODO: Transform those in targets.
	list(APPEND EXTRA_SRC
		Taisync/TaisyncManager.cc
		Taisync/TaisyncHandler.cc
		Taisync/TaisyncSettings.cc
		Microhard/MicrohardManager.cc
		Microhard/MicrohardHandler.cc
		Microhard/MicrohardSettings.cc
	)
	if(ANDROID) # Should also be expanded to iOS
		list(APPEND EXTRA_SRC
29 30
			Taisync/TaisyncTelemetry.cc
			Taisync/TaisyncVideoReceiver.cc
31 32 33
		)
	endif()
endif()
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

if(BUILD_TESTING)

	add_custom_target(check
		COMMAND ctest --output-on-failure .
		USES_TERMINAL
	)

	function (add_qgc_test test_name)
		add_test(
			NAME ${test_name}
			COMMAND $<TARGET_FILE:QGroundControl> --unittest:${test_name}
		)
		add_dependencies(check QGroundControl)
	endfunction()

50
	add_subdirectory(qgcunittest)
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

	add_qgc_test(CameraCalcTest)
	add_qgc_test(CameraSectionTest)
	add_qgc_test(CorridorScanComplexItemTest)
	add_qgc_test(FactSystemTestGeneric)
	add_qgc_test(FactSystemTestPX4)
	add_qgc_test(FileDialogTest)
	add_qgc_test(FileManagerTest)
	add_qgc_test(FlightGearUnitTest)
	add_qgc_test(GeoTest)
	add_qgc_test(LinkManagerTest)
	add_qgc_test(LogDownloadTest)
	add_qgc_test(MessageBoxTest)
	add_qgc_test(MissionCommandTreeTest)
	add_qgc_test(MissionControllerTest)
	add_qgc_test(MissionItemTest)
	add_qgc_test(MissionManagerTest)
	add_qgc_test(MissionSettingsTest)
	add_qgc_test(ParameterManagerTest)
	add_qgc_test(PlanMasterControllerTest)
	add_qgc_test(QGCMapPolygonTest)
	add_qgc_test(QGCMapPolylineTest)
	add_qgc_test(RadioConfigTest)
	add_qgc_test(SendMavCommandTest)
	add_qgc_test(SimpleMissionItemTest)
	add_qgc_test(SpeedSectionTest)
	add_qgc_test(StructureScanComplexItemTest)
	add_qgc_test(SurveyComplexItemTest)
	add_qgc_test(TCPLinkTest)
	add_qgc_test(TransectStyleComplexItemTest)

endif()

add_library(qgc

	${EXTRA_SRC}

	CmdLineOptParser.cc
89
	CmdLineOptParser.h
90
	JsonHelper.cc
91 92 93 94 95
	JsonHelper.h
	KMLDomDocument.cc
	KMLDomDocument.h
	KMLHelper.cc
	KMLHelper.h
96
	LogCompressor.cc
97
	LogCompressor.h
98
	main.cc
99
	QGC.cc
100 101 102
	QGC.h
	QGCApplication.cc
	QGCApplication.h
103
	QGCComboBox.cc
104 105
	QGCComboBox.h
	QGCConfig.h
106
	QGCDockWidget.cc
107
	QGCDockWidget.h
108
	QGCFileDownload.cc
109
	QGCFileDownload.h
110
	QGCLoggingCategory.cc
111
	QGCLoggingCategory.h
112
	QGCMapPalette.cc
113
	QGCMapPalette.h
114
	QGCPalette.cc
115
	QGCPalette.h
116
	QGCQGeoCoordinate.cc
117
	QGCQGeoCoordinate.h
118
	QGCTemporaryFile.cc
119
	QGCTemporaryFile.h
120
	QGCToolbox.cc
121
	QGCToolbox.h
122
	RunGuard.cc
123
	RunGuard.h
Daniel Agar's avatar
Daniel Agar committed
124
	ShapeFileHelper.cc
125
	ShapeFileHelper.h
Daniel Agar's avatar
Daniel Agar committed
126
	SHPFileHelper.cc
127 128
	SHPFileHelper.h
	stable_headers.h
129
	TerrainTile.cc
130
	TerrainTile.h
131 132
)

133
set_source_files_properties(QGCApplication.cc PROPERTIES COMPILE_DEFINITIONS GIT_VERSION="${GIT_VERSION}")
134

Daniel Agar's avatar
Daniel Agar committed
135 136
add_subdirectory(ui)

Daniel Agar's avatar
Daniel Agar committed
137
add_subdirectory(ADSB)
138
add_subdirectory(Airmap)
139
add_subdirectory(AnalyzeView)
140
add_subdirectory(api)
141
add_subdirectory(Audio)
142
add_subdirectory(AutoPilotPlugins)
143
add_subdirectory(Camera)
144
add_subdirectory(comm)
145
add_subdirectory(FactSystem)
146
add_subdirectory(FirmwarePlugin)
147
add_subdirectory(FlightDisplay)
148
add_subdirectory(FlightMap)
149
add_subdirectory(FollowMe)
150
add_subdirectory(Geo)
151
add_subdirectory(GPS)
152
add_subdirectory(Joystick)
153
add_subdirectory(MissionManager)
154
add_subdirectory(PlanView)
155
add_subdirectory(PositionManager)
156
add_subdirectory(QmlControls)
157
add_subdirectory(QtLocationPlugin)
158
add_subdirectory(Settings)
159
add_subdirectory(Terrain)
160
add_subdirectory(uas)
161
add_subdirectory(Vehicle)
162
add_subdirectory(VehicleSetup)
163 164
add_subdirectory(VideoManager)
add_subdirectory(VideoReceiver)
165
add_subdirectory(ViewWidgets)
166

167
target_link_libraries(qgc
Tomaz Canabrava's avatar
Tomaz Canabrava committed
168
	PRIVATE
Daniel Agar's avatar
Daniel Agar committed
169
		shp
170
                Qt5::QuickControls2
171 172

	PUBLIC
Tomaz Canabrava's avatar
Tomaz Canabrava committed
173 174
		Qt5::QuickWidgets
		Qt5::Widgets
175

Daniel Agar's avatar
Daniel Agar committed
176
                ADSB
177
		Airmap
Tomaz Canabrava's avatar
Tomaz Canabrava committed
178
		AnalyzeView
179 180 181 182 183 184 185 186 187
		api
		Audio
		AutoPilotPlugins
		Camera
		comm
		FactSystem
		FirmwarePlugin
		FlightMap
		FollowMe
188
		Geo
Tomaz Canabrava's avatar
Tomaz Canabrava committed
189
		gps
190 191 192 193 194 195 196 197 198 199 200
		Joystick
		MissionManager
		PositionManager
		QmlControls
		QtLocationPlugin
		Settings
		Terrain
		uas
		ui
		Vehicle
		VehicleSetup
201
		VideoManager
202
		ViewWidgets
203 204
)

205 206 207 208
if(BUILD_TESTING)
	target_link_libraries(qgc PUBLIC qgcunittest)
endif()

Daniel Agar's avatar
Daniel Agar committed
209
target_include_directories(qgc
Tomaz Canabrava's avatar
Tomaz Canabrava committed
210 211 212 213 214 215 216
	PUBLIC
		${CMAKE_CURRENT_SOURCE_DIR}
		${CMAKE_CURRENT_BINARY_DIR}/ui/ui_autogen/include # HACK: AUTOUIC paths not inheriting?
		${CMAKE_CURRENT_BINARY_DIR}/ui/ui_autogen/include_Debug
		${CMAKE_CURRENT_BINARY_DIR}/qgc_autogen/include # HACK: AUTOUIC paths not inheriting?
		${CMAKE_CURRENT_BINARY_DIR}/qgc_autogen/include_Debug
)
217