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
Daniel Agar's avatar
Daniel Agar committed
122 123
	QGCZlib.cc
	QGCZlib.h
124
	RunGuard.cc
125
	RunGuard.h
Daniel Agar's avatar
Daniel Agar committed
126
	ShapeFileHelper.cc
127
	ShapeFileHelper.h
Daniel Agar's avatar
Daniel Agar committed
128
	SHPFileHelper.cc
129 130
	SHPFileHelper.h
	stable_headers.h
131
	TerrainTile.cc
132
	TerrainTile.h
133 134
)

135
set_source_files_properties(QGCApplication.cc PROPERTIES COMPILE_DEFINITIONS GIT_VERSION="${GIT_VERSION}")
136

Daniel Agar's avatar
Daniel Agar committed
137 138
add_subdirectory(ui)

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

168
target_link_libraries(qgc
Tomaz Canabrava's avatar
Tomaz Canabrava committed
169
	PRIVATE
Daniel Agar's avatar
Daniel Agar committed
170
		shp
171
                Qt5::QuickControls2
Daniel Agar's avatar
Daniel Agar committed
172
                z # zlib
173 174

	PUBLIC
Tomaz Canabrava's avatar
Tomaz Canabrava committed
175 176
		Qt5::QuickWidgets
		Qt5::Widgets
177

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

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

Daniel Agar's avatar
Daniel Agar committed
210
target_include_directories(qgc
Tomaz Canabrava's avatar
Tomaz Canabrava committed
211 212 213 214 215 216 217
	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
)
218