CMakeLists.txt 4 KB
Newer Older
1

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

set(EXTRA_SRC)

if(MOBILE)
	list(APPEND EXTRA_SRC
		MobileScreenMgr.cc
	)
endif()
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
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
			src/Taisync/TaisyncTelemetry.cc
			src/Taisync/TaisyncVideoReceiver.cc
		)
	endif()
endif()
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

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()

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

	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
	JsonHelper.cc
	KMLFileHelper.cc
	LogCompressor.cc
91
	main.cc
92
	QGCApplication.cc
93
	QGC.cc
94 95 96 97 98 99 100 101 102 103 104
	QGCComboBox.cc
	QGCDockWidget.cc
	QGCFileDownload.cc
	QGCGeo.cc
	QGCLoggingCategory.cc
	QGCMapPalette.cc
	QGCPalette.cc
	QGCQGeoCoordinate.cc
	QGCTemporaryFile.cc
	QGCToolbox.cc
	RunGuard.cc
Daniel Agar's avatar
Daniel Agar committed
105 106
	ShapeFileHelper.cc
	SHPFileHelper.cc
107 108
	TerrainTile.cc

109
	UTM.cpp
110 111 112 113
)

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

Daniel Agar's avatar
Daniel Agar committed
114 115
add_subdirectory(ui)

Daniel Agar's avatar
Daniel Agar committed
116
add_subdirectory(ADSB)
117
add_subdirectory(Airmap)
118
add_subdirectory(AnalyzeView)
119
add_subdirectory(api)
120
add_subdirectory(Audio)
121
add_subdirectory(AutoPilotPlugins)
122
add_subdirectory(Camera)
123
add_subdirectory(comm)
124
add_subdirectory(FactSystem)
125
add_subdirectory(FirmwarePlugin)
126
add_subdirectory(FlightDisplay)
127
add_subdirectory(FlightMap)
128
add_subdirectory(FollowMe)
129
add_subdirectory(GPS)
130
add_subdirectory(Joystick)
131
add_subdirectory(MissionManager)
132
add_subdirectory(PlanView)
133
add_subdirectory(PositionManager)
134
add_subdirectory(QmlControls)
135
add_subdirectory(QtLocationPlugin)
136
add_subdirectory(Settings)
137
add_subdirectory(Terrain)
138
add_subdirectory(uas)
139
add_subdirectory(Vehicle)
140
add_subdirectory(VehicleSetup)
141
add_subdirectory(VideoStreaming)
142
add_subdirectory(ViewWidgets)
143

144
target_link_libraries(qgc
Tomaz Canabrava's avatar
Tomaz Canabrava committed
145
	PRIVATE
Daniel Agar's avatar
Daniel Agar committed
146
		shp
147 148

	PUBLIC
Tomaz Canabrava's avatar
Tomaz Canabrava committed
149 150
		Qt5::QuickWidgets
		Qt5::Widgets
151

Daniel Agar's avatar
Daniel Agar committed
152
                ADSB
153
		Airmap
Tomaz Canabrava's avatar
Tomaz Canabrava committed
154
		AnalyzeView
155 156 157 158 159 160 161 162 163 164
		api
		Audio
		AutoPilotPlugins
		Camera
		comm
		FactSystem
		FirmwarePlugin
		FlightDisplay
		FlightMap
		FollowMe
Tomaz Canabrava's avatar
Tomaz Canabrava committed
165
		gps
166 167 168 169 170 171 172 173 174 175 176 177 178
		Joystick
		MissionManager
		PositionManager
		QmlControls
		QtLocationPlugin
		Settings
		Terrain
		uas
		ui
		Vehicle
		VehicleSetup
		VideoStreaming
		ViewWidgets
179 180
)

181 182 183 184
if(BUILD_TESTING)
	target_link_libraries(qgc PUBLIC qgcunittest)
endif()

Daniel Agar's avatar
Daniel Agar committed
185
target_include_directories(qgc
Tomaz Canabrava's avatar
Tomaz Canabrava committed
186 187 188 189 190 191 192
	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
)
193