CMakeLists.txt 3.72 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

	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
74
	main.cc
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
	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
Daniel Agar's avatar
Daniel Agar committed
91 92
	ShapeFileHelper.cc
	SHPFileHelper.cc
93 94 95
	TerrainTile.cc
	UTM.cpp

96 97
	# UI
	QGCQmlWidgetHolder.ui
Daniel Agar's avatar
Daniel Agar committed
98
        QGCQmlWidgetHolder.h
99 100 101 102
)

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

Daniel Agar's avatar
Daniel Agar committed
103 104
add_subdirectory(ui)

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

131
target_link_libraries(qgc
132
        PRIVATE
Daniel Agar's avatar
Daniel Agar committed
133
		shp
134 135

	PUBLIC
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 163 164
                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
165 166
)

167 168 169 170
if(BUILD_TESTING)
	target_link_libraries(qgc PUBLIC qgcunittest)
endif()

Daniel Agar's avatar
Daniel Agar committed
171 172 173 174 175 176 177 178
target_include_directories(qgc
    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
        )