CMakeLists.txt 3.93 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)

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

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

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

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

178 179 180 181
if(BUILD_TESTING)
	target_link_libraries(qgc PUBLIC qgcunittest)
endif()

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