CMakeLists.txt 3.34 KB
Newer Older
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
include_directories(
	.
	${CMAKE_CURRENT_BINARY_DIR}

	${Qt5Location_PRIVATE_INCLUDE_DIRS}
)

set(EXTRA_SRC)

if(MOBILE)
	list(APPEND EXTRA_SRC
		MobileScreenMgr.cc
	)
endif()

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

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

	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

	${QGC_RESOURCES}

	${EXTRA_SRC}

	CmdLineOptParser.cc
	JsonHelper.cc
	KMLFileHelper.cc
	LogCompressor.cc
76
	main.cc
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
	QGC.cc
	QGCApplication.cc
	QGCComboBox.cc
	QGCDockWidget.cc
	QGCFileDownload.cc
	QGCGeo.cc
	QGCLoggingCategory.cc
	QGCMapPalette.cc
	QGCPalette.cc
	QGCQFileDialog.cc
	QGCQGeoCoordinate.cc
	QGCQmlWidgetHolder.cpp
	QGCQuickWidget.cc
	QGCTemporaryFile.cc
	QGCToolbox.cc
	RunGuard.cc
	TerrainTile.cc
	UTM.cpp

96 97 98
	# UI
	QGCQmlWidgetHolder.ui

99 100 101 102
)

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

103
add_subdirectory(Airmap)
104
add_subdirectory(AnalyzeView)
105
add_subdirectory(api)
106
add_subdirectory(Audio)
107
add_subdirectory(AutoPilotPlugins)
108
add_subdirectory(Camera)
109
add_subdirectory(comm)
110
add_subdirectory(FactSystem)
111
add_subdirectory(FirmwarePlugin)
112
add_subdirectory(FlightDisplay)
113
add_subdirectory(FlightMap)
114
add_subdirectory(FollowMe)
115
add_subdirectory(GPS)
116
add_subdirectory(Joystick)
117
add_subdirectory(MissionManager)
118
add_subdirectory(PositionManager)
119
add_subdirectory(QmlControls)
120
add_subdirectory(QtLocationPlugin)
121
add_subdirectory(Settings)
122
add_subdirectory(Terrain)
123
add_subdirectory(uas)
124
add_subdirectory(ui)
125
add_subdirectory(Vehicle)
126
add_subdirectory(VehicleSetup)
127
add_subdirectory(VideoStreaming)
128
add_subdirectory(ViewWidgets)
129

130
target_link_libraries(qgc
131
        PRIVATE
132 133

	PUBLIC
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
                Qt5::QuickWidgets
                Qt5::Widgets

		Airmap
                AnalyzeView
		api
		Audio
		AutoPilotPlugins
		Camera
		comm
		FactSystem
		FirmwarePlugin
		FlightDisplay
		FlightMap
		FollowMe
                gps
		Joystick
		MissionManager
		PositionManager
		QmlControls
		QtLocationPlugin
		Settings
		Terrain
		uas
		ui
		Vehicle
		VehicleSetup
		VideoStreaming
		ViewWidgets
163 164
)

165 166 167 168
if(BUILD_TESTING)
	target_link_libraries(qgc PUBLIC qgcunittest)
endif()

169
target_include_directories(qgc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})