From 37315ab55dfaef3395e632e26b60fd76a3afa258 Mon Sep 17 00:00:00 2001 From: Holden Date: Sat, 9 Mar 2024 21:00:43 -0500 Subject: [PATCH] Improve CMake Libraries --- CMakeLists.txt | 8 +- libs/qmlglsink/CMakeLists.txt | 2 +- .../src/qserialportinfo.cpp | 4 +- .../qtandroidserialport/src/qserialportinfo.h | 3 +- .../src/qserialportinfo_p.h | 8 - src/ADSB/CMakeLists.txt | 13 +- src/AirLink/CMakeLists.txt | 48 ++++-- src/AnalyzeView/CMakeLists.txt | 2 +- src/Audio/CMakeLists.txt | 5 +- src/AutoPilotPlugins/APM/CMakeLists.txt | 69 +++++---- src/AutoPilotPlugins/CMakeLists.txt | 44 +++++- src/AutoPilotPlugins/Common/CMakeLists.txt | 18 ++- src/AutoPilotPlugins/PX4/CMakeLists.txt | 4 +- src/CMakeLists.txt | 146 +++++++----------- src/Camera/CMakeLists.txt | 8 +- src/Compression/CMakeLists.txt | 8 +- src/FactSystem/CMakeLists.txt | 14 +- src/FactSystem/FactControls/CMakeLists.txt | 11 +- src/FirmwarePlugin/APM/CMakeLists.txt | 2 + src/FirmwarePlugin/CMakeLists.txt | 23 ++- src/FirmwarePlugin/PX4/CMakeLists.txt | 1 + src/FirstRunPromptDialogs/CMakeLists.txt | 8 + src/FlightDisplay/CMakeLists.txt | 24 +-- src/FlightMap/CMakeLists.txt | 19 +-- src/FlightMap/MapItems/CMakeLists.txt | 6 +- src/FlightMap/Widgets/CMakeLists.txt | 12 +- src/FollowMe/CMakeLists.txt | 11 +- src/GPS/CMakeLists.txt | 35 +++-- src/Geo/CMakeLists.txt | 6 +- src/MissionManager/CMakeLists.txt | 6 +- src/PlanView/CMakeLists.txt | 2 + src/PositionManager/CMakeLists.txt | 9 +- src/QmlControls/CMakeLists.txt | 20 +-- src/QtLocationPlugin/CMakeLists.txt | 79 +++++----- src/Settings/CMakeLists.txt | 10 +- src/Terrain/CMakeLists.txt | 13 +- src/Terrain/TerrainQuery.cc | 1 + src/Terrain/TerrainQuery.h | 1 - src/UTMSP/CMakeLists.txt | 61 +++++--- src/Utilities/CMakeLists.txt | 5 +- src/Vehicle/Actuators/CMakeLists.txt | 8 +- src/Vehicle/CMakeLists.txt | 40 +++-- src/VehicleSetup/Bootloader.cc | 7 +- src/VehicleSetup/CMakeLists.txt | 5 +- src/VideoManager/CMakeLists.txt | 8 +- src/VideoReceiver/CMakeLists.txt | 39 +++-- src/Viewer3D/CMakeLists.txt | 11 +- src/api/CMakeLists.txt | 6 +- src/comm/CMakeLists.txt | 41 ++--- src/comm/QGCSerialPortInfo.h | 1 + src/ui/CMakeLists.txt | 3 + src/ui/preferences/CMakeLists.txt | 14 +- src/ui/toolbar/CMakeLists.txt | 6 +- 53 files changed, 523 insertions(+), 435 deletions(-) create mode 100644 src/FirstRunPromptDialogs/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 59bf6b87d0b..9a845e8601f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,9 +149,6 @@ message(STATUS "QGroundControl version: ${APP_VERSION_STR}") # QGroundControl Resources ####################################################### -add_subdirectory(libs) -add_subdirectory(src) - set(QGC_RESOURCES ${CMAKE_SOURCE_DIR}/qgcimages.qrc ${CMAKE_SOURCE_DIR}/qgcresources.qrc @@ -186,11 +183,16 @@ endif() qt_add_executable(${PROJECT_NAME} src/main.cc ${QGC_RESOURCES}) +add_subdirectory(libs) +add_subdirectory(src) + set_target_properties(${PROJECT_NAME} PROPERTIES QT_RESOURCE_PREFIX "/qgc" ) +target_precompile_headers(${PROJECT_NAME} PRIVATE src/pch.h) + if(Qt6LinguistTools_FOUND) file(GLOB TS_SOURCES RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/translations/qgc_*.ts) # TODO: Update to new qt_add_translations form in Qt6.7 diff --git a/libs/qmlglsink/CMakeLists.txt b/libs/qmlglsink/CMakeLists.txt index be38246b46f..4a0235f3e26 100644 --- a/libs/qmlglsink/CMakeLists.txt +++ b/libs/qmlglsink/CMakeLists.txt @@ -95,7 +95,7 @@ if(QGC_ENABLE_VIDEOSTREAMING) ${GST_LINK_LIBRARIES} ) - target_include_directories(qmlglsink PRIVATE ${GST_INCLUDE_DIRS}) + target_include_directories(qmlglsink PUBLIC ${GST_INCLUDE_DIRS}) if (MSVC) target_include_directories(qmlglsink PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/windows) else() diff --git a/libs/qtandroidserialport/src/qserialportinfo.cpp b/libs/qtandroidserialport/src/qserialportinfo.cpp index 0b3952606fe..be3eed17c55 100644 --- a/libs/qtandroidserialport/src/qserialportinfo.cpp +++ b/libs/qtandroidserialport/src/qserialportinfo.cpp @@ -118,7 +118,7 @@ QSerialPortInfo::QSerialPortInfo(const QSerialPortInfoPrivate &dd) QSerialPortInfo::~QSerialPortInfo() { } -#if 0 + /*! \fn void QSerialPortInfo::swap(QSerialPortInfo &other) Swaps QSerialPortInfo \a other with this QSerialPortInfo. This operation is @@ -137,7 +137,7 @@ QSerialPortInfo& QSerialPortInfo::operator=(const QSerialPortInfo &other) QSerialPortInfo(other).swap(*this); return *this; } -#endif + /*! Returns the name of the serial port. diff --git a/libs/qtandroidserialport/src/qserialportinfo.h b/libs/qtandroidserialport/src/qserialportinfo.h index c1cb3bf54b8..dde6909e749 100644 --- a/libs/qtandroidserialport/src/qserialportinfo.h +++ b/libs/qtandroidserialport/src/qserialportinfo.h @@ -42,7 +42,6 @@ QT_BEGIN_NAMESPACE class QSerialPort; class QSerialPortInfoPrivate; -class QSerialPortInfoPrivateDeleter; class QSerialPortInfo { @@ -78,7 +77,7 @@ class QSerialPortInfo static QList standardBaudRates(); static QList availablePorts(); - QScopedPointer d_ptr; + std::unique_ptr d_ptr; private: QSerialPortInfo(const QSerialPortInfoPrivate &dd); diff --git a/libs/qtandroidserialport/src/qserialportinfo_p.h b/libs/qtandroidserialport/src/qserialportinfo_p.h index 5a15dcfebe7..4ca97f96f25 100644 --- a/libs/qtandroidserialport/src/qserialportinfo_p.h +++ b/libs/qtandroidserialport/src/qserialportinfo_p.h @@ -82,14 +82,6 @@ class Q_AUTOTEST_EXPORT QSerialPortInfoPrivate bool hasProductIdentifier; }; -class QSerialPortInfoPrivateDeleter -{ -public: - static void cleanup(QSerialPortInfoPrivate *p) { - delete p; - } -}; - QT_END_NAMESPACE #endif // QSERIALPORTINFO_P_H diff --git a/src/ADSB/CMakeLists.txt b/src/ADSB/CMakeLists.txt index 7a49bf36071..64ba9b8af69 100644 --- a/src/ADSB/CMakeLists.txt +++ b/src/ADSB/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Network Positioning) qt_add_library(ADSB STATIC ADSBVehicle.cc @@ -8,12 +9,12 @@ qt_add_library(ADSB STATIC target_link_libraries(ADSB PUBLIC + Qt6::Core + Qt6::Network + Qt6::Positioning + comm qgc + QmlControls ) -target_include_directories(ADSB - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ) - - +target_include_directories(ADSB PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/AirLink/CMakeLists.txt b/src/AirLink/CMakeLists.txt index a78a0ab68a7..5880b216175 100644 --- a/src/AirLink/CMakeLists.txt +++ b/src/AirLink/CMakeLists.txt @@ -1,20 +1,34 @@ -find_package(Qt6 COMPONENTS Core Network REQUIRED) +find_package(Qt6 REQUIRED COMPONENTS Core) -qt_add_library(AirLink STATIC - AirlinkLink.cc - AirlinkLink.h - AirLinkManager.cc - AirLinkManager.h - AirLinkSettings.qml -) +qt_add_library(AirLink STATIC) -target_link_libraries(AirLink - PUBLIC - Qt6::Core - Qt6::Network - FactSystem - Settings - qgc -) +option(QGC_AIRLINK_DISABLED "Enable airlink" OFF) +if(NOT ${QGC_AIRLINK_DISABLED}) + find_package(Qt6 COMPONENTS Network REQUIRED) -target_include_directories(AirLink PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + target_sources(AirLink + PRIVATE + AirlinkLink.cc + AirlinkLink.h + AirLinkManager.cc + AirLinkManager.h + ) + + add_custom_target(AirLinkQml + SOURCES + AirLinkSettings.qml + ) + + target_link_libraries(AirLink + PUBLIC + Qt6::Core + Qt6::Network + FactSystem + Settings + qgc + ) + + target_include_directories(AirLink PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +else() + target_compile_definitions(AirLink PUBLIC QGC_AIRLINK_DISABLED) +endif() diff --git a/src/AnalyzeView/CMakeLists.txt b/src/AnalyzeView/CMakeLists.txt index 670d343e92e..6946ce1e738 100644 --- a/src/AnalyzeView/CMakeLists.txt +++ b/src/AnalyzeView/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_library(AnalyzeView STATIC ExifParser.cc @@ -34,7 +35,6 @@ target_link_libraries(AnalyzeView PUBLIC Qt6::Charts Qt6::Location - Qt6::SerialPort Qt6::TextToSpeech Qt6::Widgets ) diff --git a/src/Audio/CMakeLists.txt b/src/Audio/CMakeLists.txt index 4006cf4fbf8..2e8cc47f3f3 100644 --- a/src/Audio/CMakeLists.txt +++ b/src/Audio/CMakeLists.txt @@ -1,16 +1,17 @@ +find_package(Qt6 REQUIRED COMPONENTS Core TextToSpeech Widgets) qt_add_library(Audio STATIC AudioOutput.cc + AudioOutput.h ) target_link_libraries(Audio PRIVATE + Qt6::Widgets qgc PUBLIC Qt6::Core - Qt6::Qml Qt6::TextToSpeech - Qt6::Widgets ) target_include_directories(Audio PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/AutoPilotPlugins/APM/CMakeLists.txt b/src/AutoPilotPlugins/APM/CMakeLists.txt index 8cd4709cd24..a72182cf289 100644 --- a/src/AutoPilotPlugins/APM/CMakeLists.txt +++ b/src/AutoPilotPlugins/APM/CMakeLists.txt @@ -1,36 +1,37 @@ -add_custom_target(APMAutoPilotPluginQml -SOURCES - APMAirframeComponent.qml - APMAirframeComponentSummary.qml - APMCameraComponent.qml - APMCameraComponentSummary.qml - APMCameraSubComponent.qml - APMFlightModesComponent.qml - APMFlightModesComponentSummary.qml - APMHeliComponent.qml - APMLightsComponent.qml - APMLightsComponentSummary.qml - APMNotSupported.qml - APMPowerComponent.qml - APMPowerComponentSummary.qml - APMRadioComponentSummary.qml - APMRemoteSupportComponent.qml - APMSafetyComponent.qml - APMSafetyComponentCopter.qml - APMSafetyComponentPlane.qml - APMSafetyComponentRover.qml - APMSafetyComponentSub.qml - APMSafetyComponentSummary.qml - APMSafetyComponentSummaryCopter.qml - APMSafetyComponentSummaryPlane.qml - APMSafetyComponentSummaryRover.qml - APMSafetyComponentSummarySub.qml - APMSensorsComponent.qml - APMSensorsComponentSummary.qml - APMSubFrameComponent.qml - APMSubFrameComponentSummary.qml - APMSubMotorComponent.qml - APMTuningComponentCopter.qml - APMTuningComponentSub.qml +find_package(Qt6 REQUIRED COMPONENTS Core Qml) +add_custom_target(APMAutoPilotPluginQml + SOURCES + APMAirframeComponent.qml + APMAirframeComponentSummary.qml + APMCameraComponent.qml + APMCameraComponentSummary.qml + APMCameraSubComponent.qml + APMFlightModesComponent.qml + APMFlightModesComponentSummary.qml + APMHeliComponent.qml + APMLightsComponent.qml + APMLightsComponentSummary.qml + APMNotSupported.qml + APMPowerComponent.qml + APMPowerComponentSummary.qml + APMRadioComponentSummary.qml + APMRemoteSupportComponent.qml + APMSafetyComponent.qml + APMSafetyComponentCopter.qml + APMSafetyComponentPlane.qml + APMSafetyComponentRover.qml + APMSafetyComponentSub.qml + APMSafetyComponentSummary.qml + APMSafetyComponentSummaryCopter.qml + APMSafetyComponentSummaryPlane.qml + APMSafetyComponentSummaryRover.qml + APMSafetyComponentSummarySub.qml + APMSensorsComponent.qml + APMSensorsComponentSummary.qml + APMSubFrameComponent.qml + APMSubFrameComponentSummary.qml + APMSubMotorComponent.qml + APMTuningComponentCopter.qml + APMTuningComponentSub.qml ) diff --git a/src/AutoPilotPlugins/CMakeLists.txt b/src/AutoPilotPlugins/CMakeLists.txt index a874588f565..9b391cceb4f 100644 --- a/src/AutoPilotPlugins/CMakeLists.txt +++ b/src/AutoPilotPlugins/CMakeLists.txt @@ -1,55 +1,83 @@ - add_subdirectory(APM) add_subdirectory(Common) add_subdirectory(PX4) +find_package(Qt6 REQUIRED COMPONENTS Core) + qt_add_library(AutoPilotPlugins STATIC APM/APMAirframeComponent.cc + APM/APMAirframeComponent.h APM/APMAirframeComponentController.cc + APM/APMAirframeComponentController.h APM/APMAutoPilotPlugin.cc + APM/APMAutoPilotPlugin.h APM/APMCameraComponent.cc + APM/APMCameraComponent.h APM/APMFlightModesComponent.cc + APM/APMFlightModesComponent.h APM/APMFlightModesComponentController.cc + APM/APMFlightModesComponentController.h APM/APMFollowComponent.cc + APM/APMFollowComponent.h APM/APMFollowComponentController.cc + APM/APMFollowComponentController.h APM/APMHeliComponent.cc + APM/APMHeliComponent.h APM/APMLightsComponent.cc + APM/APMLightsComponent.h APM/APMMotorComponent.cc + APM/APMMotorComponent.h APM/APMPowerComponent.cc + APM/APMPowerComponent.h APM/APMRadioComponent.cc + APM/APMRadioComponent.h APM/APMRemoteSupportComponent.cc + APM/APMRemoteSupportComponent.h APM/APMSafetyComponent.cc + APM/APMSafetyComponent.h APM/APMSensorsComponent.cc + APM/APMSensorsComponent.h APM/APMSensorsComponentController.cc + APM/APMSensorsComponentController.h APM/APMSubFrameComponent.cc + APM/APMSubFrameComponent.h APM/APMSubMotorComponentController.cc + APM/APMSubMotorComponentController.h APM/APMTuningComponent.cc + APM/APMTuningComponent.h Common/ESP8266Component.cc + Common/ESP8266Component.h Common/ESP8266ComponentController.cc + Common/ESP8266ComponentController.h Common/MotorComponent.cc + Common/MotorComponent.h Common/RadioComponentController.cc + Common/RadioComponentController.h Common/SyslinkComponent.cc + Common/SyslinkComponent.h Common/SyslinkComponentController.cc + Common/SyslinkComponentController.h Generic/GenericAutoPilotPlugin.cc + Generic/GenericAutoPilotPlugin.h PX4/ActuatorComponent.cc PX4/ActuatorComponent.h + PX4/AirframeComponent.cc + PX4/AirframeComponent.h PX4/AirframeComponentAirframes.cc PX4/AirframeComponentAirframes.h - PX4/AirframeComponent.cc PX4/AirframeComponentController.cc PX4/AirframeComponentController.h - PX4/AirframeComponent.h PX4/CameraComponent.cc PX4/CameraComponent.h PX4/FlightModesComponent.cc PX4/FlightModesComponent.h PX4/PowerComponent.cc + PX4/PowerComponent.h PX4/PowerComponentController.cc PX4/PowerComponentController.h - PX4/PowerComponent.h PX4/PX4AirframeLoader.cc PX4/PX4AirframeLoader.h PX4/PX4AutoPilotPlugin.cc @@ -65,11 +93,12 @@ qt_add_library(AutoPilotPlugins STATIC PX4/SafetyComponent.cc PX4/SafetyComponent.h PX4/SensorsComponent.cc + PX4/SensorsComponent.h PX4/SensorsComponentController.cc PX4/SensorsComponentController.h - PX4/SensorsComponent.h AutoPilotPlugin.cc + AutoPilotPlugin.h ) target_link_libraries(AutoPilotPlugins @@ -78,10 +107,9 @@ target_link_libraries(AutoPilotPlugins ) target_include_directories(AutoPilotPlugins - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} APM Common PX4 - ) +) diff --git a/src/AutoPilotPlugins/Common/CMakeLists.txt b/src/AutoPilotPlugins/Common/CMakeLists.txt index 60f3e8382b9..9a71d157e56 100644 --- a/src/AutoPilotPlugins/Common/CMakeLists.txt +++ b/src/AutoPilotPlugins/Common/CMakeLists.txt @@ -1,9 +1,11 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + add_custom_target(CommonAutoPilotPluginQml -SOURCES - ESP8266Component.qml - ESP8266ComponentSummary.qml - MotorComponent.qml - RadioComponent.qml - SetupPage.qml - SyslinkComponent.qml -) \ No newline at end of file + SOURCES + ESP8266Component.qml + ESP8266ComponentSummary.qml + MotorComponent.qml + RadioComponent.qml + SetupPage.qml + SyslinkComponent.qml +) diff --git a/src/AutoPilotPlugins/PX4/CMakeLists.txt b/src/AutoPilotPlugins/PX4/CMakeLists.txt index c532b7be8f3..b411af2daa9 100644 --- a/src/AutoPilotPlugins/PX4/CMakeLists.txt +++ b/src/AutoPilotPlugins/PX4/CMakeLists.txt @@ -1,3 +1,5 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + add_custom_target(PX4AutoPilotPluginQml SOURCES AirframeComponent.qml @@ -17,7 +19,7 @@ add_custom_target(PX4AutoPilotPluginQml SafetyComponent.qml SafetyComponentSummary.qml SensorsComponent.qml - SensorsComponentSummaryFixedWing.qml SensorsComponentSummary.qml + SensorsComponentSummaryFixedWing.qml SensorsSetup.qml ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1c02c8c81f7..6891a908199 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,29 +1,17 @@ -####################################################### -# Main QGC library -####################################################### -project(qgc) - -####################################################### -# Source Files -####################################################### -qt_add_library(${PROJECT_NAME} STATIC - CmdLineOptParser.cc - CmdLineOptParser.h - QGCApplication.cc - QGCApplication.h - QGCConfig.h - QGCToolbox.cc - QGCToolbox.h +qt_add_library(qgc STATIC + CmdLineOptParser.cc + CmdLineOptParser.h + QGCApplication.cc + QGCApplication.h + QGCConfig.h + QGCToolbox.cc + QGCToolbox.h ) -target_precompile_headers(${PROJECT_NAME} PRIVATE pch.h) - set_source_files_properties(QGCApplication.cc PROPERTIES COMPILE_DEFINITIONS APP_VERSION_STR="${APP_VERSION_STR}") -# Subdirectories -add_subdirectory(ui) - add_subdirectory(ADSB) +add_subdirectory(AirLink) add_subdirectory(AnalyzeView) add_subdirectory(api) add_subdirectory(Audio) @@ -45,11 +33,8 @@ add_subdirectory(PositionManager) add_subdirectory(QmlControls) add_subdirectory(QtLocationPlugin) add_subdirectory(Settings) -option(QGC_AIRLINK_DISABLED "Enable airlink" OFF) -if (NOT ${QGC_AIRLINK_DISABLED}) - add_subdirectory(AirLink) -endif() add_subdirectory(Terrain) +add_subdirectory(ui) add_subdirectory(Utilities) add_subdirectory(UTMSP) add_subdirectory(Vehicle) @@ -61,74 +46,57 @@ add_subdirectory(Viewer3D) ####################################################### # Linking Libraries ####################################################### -target_link_libraries(${PROJECT_NAME} - PRIVATE - PUBLIC - Qt6::QuickControls2 - Qt6::QuickWidgets - Qt6::Widgets - Qt6::Core5Compat - Qt6::SerialPort +target_link_libraries(qgc + PRIVATE + PUBLIC + Qt6::QuickControls2 + Qt6::QuickWidgets + Qt6::Widgets + Qt6::Core5Compat - ADSB - AnalyzeView - api - Audio - AutoPilotPlugins - Camera - comm - compression - FactSystem - FirmwarePlugin - FlightMap - FollowMe - Geo - gps - Joystick - MissionManager - PositionManager - QmlControls - QGCLocation - Settings - Terrain - Utilities - UTMSP - Vehicle - VehicleSetup - VideoManager - Viewer3D + ADSB + AirLink + AnalyzeView + api + Audio + AutoPilotPlugins + Camera + comm + compression + FactSystem + FirmwarePlugin + FlightMap + FollowMe + Geo + gps + Joystick + MissionManager + PositionManager + QmlControls + QGCLocation + Settings + Terrain + Utilities + UTMSP + Vehicle + VehicleSetup + VideoManager + Viewer3D ) -if(NOT ${QGC_AIRLINK_DISABLED}) - target_link_libraries(${PROJECT_NAME} PUBLIC AirLink) -else() - target_compile_definitions(${PROJECT_NAME} PUBLIC QGC_AIRLINK_DISABLED) -endif() - -target_include_directories(${PROJECT_NAME} - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) +target_include_directories(qgc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) if(ANDROID) - target_sources(${PROJECT_NAME} - PRIVATE - ${CMAKE_SOURCE_DIR}/android/src/AndroidInterface.cc - ${CMAKE_SOURCE_DIR}/android/src/AndroidInterface.h - ) - target_link_libraries(${PROJECT_NAME} - PUBLIC - qtandroidserialport - ) - - target_include_directories(${PROJECT_NAME} - PUBLIC - ${CMAKE_SOURCE_DIR}/android/src - ) + target_sources(qgc + PRIVATE + ${CMAKE_SOURCE_DIR}/android/src/AndroidInterface.cc + ${CMAKE_SOURCE_DIR}/android/src/AndroidInterface.h + ) + target_include_directories(qgc PUBLIC ${CMAKE_SOURCE_DIR}/android/src) else() - target_sources(${PROJECT_NAME} - PRIVATE - RunGuard.cc - RunGuard.h - ) + target_sources(qgc + PRIVATE + RunGuard.cc + RunGuard.h + ) endif() diff --git a/src/Camera/CMakeLists.txt b/src/Camera/CMakeLists.txt index 9736ae32989..30213b75489 100644 --- a/src/Camera/CMakeLists.txt +++ b/src/Camera/CMakeLists.txt @@ -1,10 +1,16 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_library(Camera STATIC MavlinkCameraControl.cc - VehicleCameraControl.cc + MavlinkCameraControl.h QGCCameraIO.cc + QGCCameraIO.h QGCCameraManager.cc + QGCCameraManager.h SimulatedCameraControl.cc + SimulatedCameraControl.h + VehicleCameraControl.cc + VehicleCameraControl.h ) target_link_libraries(Camera diff --git a/src/Compression/CMakeLists.txt b/src/Compression/CMakeLists.txt index bef78565e6c..7a72a0de2ae 100644 --- a/src/Compression/CMakeLists.txt +++ b/src/Compression/CMakeLists.txt @@ -1,3 +1,5 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) + qt_add_library(compression STATIC QGCLZMA.cc QGCLZMA.h @@ -11,10 +13,6 @@ target_link_libraries(compression xz PUBLIC Qt6::Core - qgc ) -target_include_directories(compression - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) +target_include_directories(compression PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/FactSystem/CMakeLists.txt b/src/FactSystem/CMakeLists.txt index 3579ffa4998..eba6847fbcb 100644 --- a/src/FactSystem/CMakeLists.txt +++ b/src/FactSystem/CMakeLists.txt @@ -1,11 +1,12 @@ - add_subdirectory(FactControls) +find_package(Qt6 REQUIRED COMPONENTS Core) + qt_add_library(FactSystem STATIC Fact.cc + Fact.h FactGroup.cc FactGroup.h - Fact.h FactMetaData.cc FactMetaData.h FactSystem.cc @@ -19,14 +20,9 @@ qt_add_library(FactSystem STATIC ) target_link_libraries(FactSystem - PRIVATE + PUBLIC qgc FactControls ) -target_include_directories(FactSystem - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR} - PUBLIC - FactControls -) +target_include_directories(FactSystem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/FactSystem/FactControls/CMakeLists.txt b/src/FactSystem/FactControls/CMakeLists.txt index 5400a86f877..54687fa4e00 100644 --- a/src/FactSystem/FactControls/CMakeLists.txt +++ b/src/FactSystem/FactControls/CMakeLists.txt @@ -1,10 +1,12 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + qt_add_library(FactControls STATIC FactPanelController.cc + FactPanelController.h ) add_custom_target(FactControlsQml SOURCES - FactPanelController.h AltitudeFactTextField.qml FactBitmask.qml FactCheckBox.qml @@ -20,4 +22,9 @@ add_custom_target(FactControlsQml LabelledFactSlider.qml ) -target_link_libraries(FactControls qgc) +target_link_libraries(FactControls + PUBLIC + qgc +) + +target_include_directories(FactControls PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/FirmwarePlugin/APM/CMakeLists.txt b/src/FirmwarePlugin/APM/CMakeLists.txt index 439f52b52ec..9bc72ff17b7 100644 --- a/src/FirmwarePlugin/APM/CMakeLists.txt +++ b/src/FirmwarePlugin/APM/CMakeLists.txt @@ -1,3 +1,5 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + add_custom_target(APMFirmwarePluginQml SOURCES APMBatteryIndicator.qml diff --git a/src/FirmwarePlugin/CMakeLists.txt b/src/FirmwarePlugin/CMakeLists.txt index 79b51ef9fcb..79f6be770d3 100644 --- a/src/FirmwarePlugin/CMakeLists.txt +++ b/src/FirmwarePlugin/CMakeLists.txt @@ -1,23 +1,39 @@ add_subdirectory(APM) add_subdirectory(PX4) +find_package(Qt6 REQUIRED COMPONENTS Core) + qt_add_library(FirmwarePlugin STATIC CameraMetaData.cc + CameraMetaData.h FirmwarePlugin.cc + FirmwarePlugin.h FirmwarePluginManager.cc + FirmwarePluginManager.h APM/APMFirmwarePlugin.cc + APM/APMFirmwarePlugin.h APM/APMFirmwarePluginFactory.cc + APM/APMFirmwarePluginFactory.h APM/APMParameterMetaData.cc + APM/APMParameterMetaData.h APM/ArduCopterFirmwarePlugin.cc + APM/ArduCopterFirmwarePlugin.h APM/ArduPlaneFirmwarePlugin.cc + APM/ArduPlaneFirmwarePlugin.h APM/ArduRoverFirmwarePlugin.cc + APM/ArduRoverFirmwarePlugin.h APM/ArduSubFirmwarePlugin.cc + APM/ArduSubFirmwarePlugin.h APM/APMResources.qrc + PX4/px4_custom_mode.h PX4/PX4FirmwarePlugin.cc + PX4/PX4FirmwarePlugin.h PX4/PX4FirmwarePluginFactory.cc + PX4/PX4FirmwarePluginFactory.h PX4/PX4ParameterMetaData.cc + PX4/PX4ParameterMetaData.h PX4/PX4Resources.qrc ) @@ -27,8 +43,7 @@ target_link_libraries(FirmwarePlugin ) target_include_directories(FirmwarePlugin - INTERFACE + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} - APM - ) - + APM +) diff --git a/src/FirmwarePlugin/PX4/CMakeLists.txt b/src/FirmwarePlugin/PX4/CMakeLists.txt index f01d63d8707..48645eb6dfe 100644 --- a/src/FirmwarePlugin/PX4/CMakeLists.txt +++ b/src/FirmwarePlugin/PX4/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) add_custom_target(PX4FirmwarePluginQml SOURCES diff --git a/src/FirstRunPromptDialogs/CMakeLists.txt b/src/FirstRunPromptDialogs/CMakeLists.txt new file mode 100644 index 00000000000..142bd4471f9 --- /dev/null +++ b/src/FirstRunPromptDialogs/CMakeLists.txt @@ -0,0 +1,8 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + +add_custom_target(FirstRunPromptDialogs + SOURCES + FirstRunPrompt.qml + OfflineVehicleFirstRunPrompt.qml + UnitsFirstRunPrompt.qml +) diff --git a/src/FlightDisplay/CMakeLists.txt b/src/FlightDisplay/CMakeLists.txt index 1ec7d16c41b..8b06cc296dd 100644 --- a/src/FlightDisplay/CMakeLists.txt +++ b/src/FlightDisplay/CMakeLists.txt @@ -1,37 +1,39 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) -add_custom_target(FligthDisplayQml +add_custom_target(FlightDisplayQml SOURCES DefaultChecklist.qml FixedWingChecklist.qml FlightDisplayViewDummy.qml FlightDisplayViewUVC.qml FlightDisplayViewVideo.qml - FlyViewBottomRightRowLayout.qml + FlyView.qml FlyViewCustomLayer.qml FlyViewInstrumentPanel.qml FlyViewMap.qml FlyViewMissionCompleteDialog.qml FlyViewPreFlightChecklistPopup.qml - FlyView.qml - FlyViewToolStripActionList.qml FlyViewToolStrip.qml - FlyViewTopRightColumnLayout.qml + FlyViewToolStripActionList.qml FlyViewVideo.qml FlyViewWidgetLayer.qml + GripperMenu.qml GuidedActionActionList.qml GuidedActionConfirm.qml + GuidedActionGripper.qml GuidedActionLand.qml GuidedActionList.qml GuidedActionPause.qml GuidedActionRTL.qml GuidedActionsController.qml GuidedActionTakeoff.qml - GuidedActionGripper.qml - GripperMenu.qml - GuidedValueSlider.qml GuidedToolStripAction.qml + GuidedValueSlider.qml MultiRotorChecklist.qml MultiVehicleList.qml + ObstacleDistanceOverlay.qml + ObstacleDistanceOverlayMap.qml + ObstacleDistanceOverlayVideo.qml PreFlightBatteryCheck.qml PreFlightCheckList.qml PreFlightCheckListShowAction.qml @@ -48,8 +50,6 @@ add_custom_target(FligthDisplayQml VehicleWarnings.qml VirtualJoystick.qml VTOLChecklist.qml - ObstacleDistanceOverlay.qml - ObstacleDistanceOverlayMap.qml - ObstacleDistanceOverlayVideo.qml + FlyViewBottomRightRowLayout.qml + FlyViewTopRightColumnLayout.qml ) - diff --git a/src/FlightMap/CMakeLists.txt b/src/FlightMap/CMakeLists.txt index 06f322e91d3..85cfae1d195 100644 --- a/src/FlightMap/CMakeLists.txt +++ b/src/FlightMap/CMakeLists.txt @@ -1,24 +1,11 @@ - add_subdirectory(MapItems) add_subdirectory(Widgets) -qt_add_library(FlightMap STATIC - #Widgets/ValuesWidgetController.cc -) - -target_link_libraries(FlightMap - PRIVATE - qgc -) +find_package(Qt6 REQUIRED COMPONENTS Core Qml) -target_include_directories(FlightMap - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - INTERFACE - Widgets - ) +qt_add_library(FlightMap STATIC) -add_custom_target(FligthMapQml +add_custom_target(FlightMapQml FlightMap.qml MapScale.qml QGCVideoBackground.qml diff --git a/src/FlightMap/MapItems/CMakeLists.txt b/src/FlightMap/MapItems/CMakeLists.txt index 5cd04a4d496..fd661a1dd0c 100644 --- a/src/FlightMap/MapItems/CMakeLists.txt +++ b/src/FlightMap/MapItems/CMakeLists.txt @@ -1,9 +1,11 @@ -add_custom_target(FligthMapItemsQml +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + +add_custom_target(FlightMapItemsQml SOURCES CameraTriggerIndicator.qml CustomMapItems.qml - MissionItemIndicatorDrag.qml MissionItemIndicator.qml + MissionItemIndicatorDrag.qml MissionItemView.qml MissionLineView.qml PlanMapItems.qml diff --git a/src/FlightMap/Widgets/CMakeLists.txt b/src/FlightMap/Widgets/CMakeLists.txt index 14ab396007e..a7f81866ba7 100644 --- a/src/FlightMap/Widgets/CMakeLists.txt +++ b/src/FlightMap/Widgets/CMakeLists.txt @@ -1,12 +1,10 @@ -add_custom_target(FligthMapWidgetsQml +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + +add_custom_target(FlightMapWidgetsQml SOURCES CenterMapDropButton.qml CenterMapDropPanel.qml - CompassDial.qml - CompassHeadingIndicator.qml HorizontalCompassAttitude.qml - IntegratedAttitudeIndicator.qml - IntegratedCompassAttitude.qml MapFitFunctions.qml PhotoVideoControl.qml QGCArtificialHorizon.qml @@ -16,5 +14,9 @@ add_custom_target(FligthMapWidgetsQml QGCPitchIndicator.qml QGCWaypointEditor.qml VerticalCompassAttitude.qml + CompassDial.qml + CompassHeadingIndicator.qml + IntegratedAttitudeIndicator.qml + IntegratedCompassAttitude.qml ) diff --git a/src/FollowMe/CMakeLists.txt b/src/FollowMe/CMakeLists.txt index b1bee1ba1a7..27927b05f4e 100644 --- a/src/FollowMe/CMakeLists.txt +++ b/src/FollowMe/CMakeLists.txt @@ -1,15 +1,16 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Positioning) qt_add_library(FollowMe STATIC FollowMe.cc + FollowMe.h ) target_link_libraries(FollowMe PUBLIC + Qt6::Core + Qt6::Positioning + comm qgc ) -target_include_directories(FollowMe - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ) - +target_include_directories(FollowMe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/GPS/CMakeLists.txt b/src/GPS/CMakeLists.txt index 8120e7768d7..4ff486868c9 100644 --- a/src/GPS/CMakeLists.txt +++ b/src/GPS/CMakeLists.txt @@ -1,26 +1,41 @@ - +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_library(gps STATIC + definitions.h Drivers/src/ashtech.cpp + Drivers/src/ashtech.h Drivers/src/gps_helper.cpp + Drivers/src/gps_helper.h Drivers/src/mtk.cpp + Drivers/src/mtk.h Drivers/src/rtcm.cpp + Drivers/src/rtcm.h Drivers/src/sbf.cpp + Drivers/src/sbf.h Drivers/src/ubx.cpp + Drivers/src/ubx.h GPSManager.cc + GPSManager.h + GPSPositionMessage.h GPSProvider.cc + GPSProvider.h RTCM/RTCMMavlink.cc + RTCM/RTCMMavlink.h + satellite_info.h + sensor_gnss_relative.h + sensor_gps.h ) target_link_libraries(gps - Qt6::Core - Qt6::Location - Qt6::SerialPort - Qt6::Svg - Qt6::TextToSpeech - - qgc + PUBLIC + Qt6::Core + comm + qgc ) -target_include_directories(gps INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - +target_include_directories(gps + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + Drivers/src + RTCM +) diff --git a/src/Geo/CMakeLists.txt b/src/Geo/CMakeLists.txt index 5e6738162ce..be0ba402b1c 100644 --- a/src/Geo/CMakeLists.txt +++ b/src/Geo/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Positioning) qt_add_library(Geo STATIC Constants.hpp @@ -19,12 +20,13 @@ qt_add_library(Geo STATIC ) target_link_libraries(Geo + PRIVATE + Qt6::Core PUBLIC - qgc + Qt6::Positioning ) target_include_directories(Geo PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) - diff --git a/src/MissionManager/CMakeLists.txt b/src/MissionManager/CMakeLists.txt index f0488927e2b..ed229537462 100644 --- a/src/MissionManager/CMakeLists.txt +++ b/src/MissionManager/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_library(MissionManager STATIC BlankPlanCreator.cc @@ -103,7 +104,4 @@ target_link_libraries(MissionManager qgc ) -target_include_directories(MissionManager - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) +target_include_directories(MissionManager PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/PlanView/CMakeLists.txt b/src/PlanView/CMakeLists.txt index b416641370e..cd3bdf91fed 100644 --- a/src/PlanView/CMakeLists.txt +++ b/src/PlanView/CMakeLists.txt @@ -1,3 +1,5 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + add_custom_target(PlanViewQml SOURCES CameraCalcCamera.qml diff --git a/src/PositionManager/CMakeLists.txt b/src/PositionManager/CMakeLists.txt index 7d616046ade..1d70e3f5702 100644 --- a/src/PositionManager/CMakeLists.txt +++ b/src/PositionManager/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Positioning) qt_add_library(PositionManager STATIC PositionManager.cpp @@ -8,11 +9,9 @@ qt_add_library(PositionManager STATIC target_link_libraries(PositionManager PUBLIC + Qt6::Core + Qt6::Positioning qgc ) -target_include_directories(PositionManager - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ) - +target_include_directories(PositionManager PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/QmlControls/CMakeLists.txt b/src/QmlControls/CMakeLists.txt index 39250433461..c700ba93ba5 100644 --- a/src/QmlControls/CMakeLists.txt +++ b/src/QmlControls/CMakeLists.txt @@ -1,6 +1,11 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + qt_add_library(QmlControls STATIC AppMessages.cc AppMessages.h + CustomAction.h + CustomActionManager.cc + CustomActionManager.h EditPositionDialogController.cc EditPositionDialogController.h FactValueGrid.cc @@ -11,10 +16,6 @@ qt_add_library(QmlControls STATIC HorizontalFactValueGrid.h InstrumentValueData.cc InstrumentValueData.h - QGCMapPalette.cc - QGCMapPalette.h - QGCPalette.cc - QGCPalette.h ParameterEditorController.cc ParameterEditorController.h QGCFileDialogController.cc @@ -40,9 +41,10 @@ qt_add_library(QmlControls STATIC ToolStripAction.h ToolStripActionList.cc ToolStripActionList.h - CustomAction.h - CustomActionManager.h - CustomActionManager.cc + QGCMapPalette.cc + QGCMapPalette.h + QGCPalette.cc + QGCPalette.h ) add_custom_target(QmlControlsQml @@ -142,14 +144,12 @@ add_custom_target(QmlControlsQml target_link_libraries(QmlControls PUBLIC qgc - FactSystem PUBLIC Qt6::Concurrent Qt6::Location - Qt6::SerialPort Qt6::TextToSpeech Qt6::Widgets ) -target_include_directories(QmlControls INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(QmlControls PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/QtLocationPlugin/CMakeLists.txt b/src/QtLocationPlugin/CMakeLists.txt index 2711f6668fd..63552dee9fd 100644 --- a/src/QtLocationPlugin/CMakeLists.txt +++ b/src/QtLocationPlugin/CMakeLists.txt @@ -2,48 +2,47 @@ find_package(Qt6 REQUIRED COMPONENTS Core Core5Compat Location Network Qml Sql) # QGC_NO_GOOGLE_MAPS -qt_add_plugin(QGCLocation - STATIC +qt_add_plugin(QGCLocation STATIC CLASS_NAME QGeoServiceProviderFactoryQGC OUTPUT_TARGETS QGCLocation_targets - QMLControl/QGCMapEngineManager.cc - QMLControl/QGCMapEngineManager.h - BingMapProvider.cpp - BingMapProvider.h - ElevationMapProvider.cpp - ElevationMapProvider.h - EsriMapProvider.cpp - EsriMapProvider.h - GenericMapProvider.cpp - GenericMapProvider.h - GoogleMapProvider.cpp - GoogleMapProvider.h - MapboxMapProvider.cpp - MapboxMapProvider.h - MapProvider.cpp - MapProvider.h - QGCMapEngine.cpp - QGCMapEngine.h - QGCMapEngineData.h - QGCMapTileSet.cpp - QGCMapTileSet.h - QGCMapUrlEngine.cpp - QGCMapUrlEngine.h - QGCTileCacheWorker.cpp - QGCTileCacheWorker.h - QGCTileSet.h - QGeoCodeReplyQGC.cpp - QGeoCodeReplyQGC.h - QGeoCodingManagerEngineQGC.cpp - QGeoCodingManagerEngineQGC.h - QGeoMapReplyQGC.cpp - QGeoMapReplyQGC.h - QGeoServiceProviderPluginQGC.cpp - QGeoServiceProviderPluginQGC.h - QGeoTiledMappingManagerEngineQGC.cpp - QGeoTiledMappingManagerEngineQGC.h - QGeoTileFetcherQGC.cpp - QGeoTileFetcherQGC.h + BingMapProvider.cpp + BingMapProvider.h + ElevationMapProvider.cpp + ElevationMapProvider.h + EsriMapProvider.cpp + EsriMapProvider.h + GenericMapProvider.cpp + GenericMapProvider.h + GoogleMapProvider.cpp + GoogleMapProvider.h + MapboxMapProvider.cpp + MapboxMapProvider.h + MapProvider.cpp + MapProvider.h + QGCMapEngine.cpp + QGCMapEngine.h + QGCMapEngineData.h + QGCMapTileSet.cpp + QGCMapTileSet.h + QGCMapUrlEngine.cpp + QGCMapUrlEngine.h + QGCTileCacheWorker.cpp + QGCTileCacheWorker.h + QGCTileSet.h + QGeoCodeReplyQGC.cpp + QGeoCodeReplyQGC.h + QGeoCodingManagerEngineQGC.cpp + QGeoCodingManagerEngineQGC.h + QGeoMapReplyQGC.cpp + QGeoMapReplyQGC.h + QGeoServiceProviderPluginQGC.cpp + QGeoServiceProviderPluginQGC.h + QGeoTiledMappingManagerEngineQGC.cpp + QGeoTiledMappingManagerEngineQGC.h + QGeoTileFetcherQGC.cpp + QGeoTileFetcherQGC.h + QMLControl/QGCMapEngineManager.cc + QMLControl/QGCMapEngineManager.h ) target_compile_definitions(QGCLocation PRIVATE CMAKE_LOCATION_PLUGIN) diff --git a/src/Settings/CMakeLists.txt b/src/Settings/CMakeLists.txt index fd9ecd21768..06c10966b63 100644 --- a/src/Settings/CMakeLists.txt +++ b/src/Settings/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_library(Settings STATIC ADSBVehicleManagerSettings.cc @@ -22,12 +23,12 @@ qt_add_library(Settings STATIC FlightModeSettings.h FlyViewSettings.cc FlyViewSettings.h - MapsSettings.cc - MapsSettings.h OfflineMapsSettings.cc OfflineMapsSettings.h PlanViewSettings.cc PlanViewSettings.h + RemoteIDSettings.cc + RemoteIDSettings.h RTKSettings.cc RTKSettings.h SettingsGroup.cc @@ -38,10 +39,10 @@ qt_add_library(Settings STATIC UnitsSettings.h VideoSettings.cc VideoSettings.h + MapsSettings.cc + MapsSettings.h Viewer3DSettings.cc Viewer3DSettings.h - RemoteIDSettings.h - RemoteIDSettings.cc ) target_link_libraries(Settings @@ -51,4 +52,3 @@ target_link_libraries(Settings ) target_include_directories(Settings PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) - diff --git a/src/Terrain/CMakeLists.txt b/src/Terrain/CMakeLists.txt index b3d0549e5f5..378ee7c23f1 100644 --- a/src/Terrain/CMakeLists.txt +++ b/src/Terrain/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Location Network Positioning) qt_add_library(Terrain STATIC TerrainQuery.cc @@ -8,11 +9,13 @@ qt_add_library(Terrain STATIC target_link_libraries(Terrain PRIVATE + Qt6::LocationPrivate qgc -) - -target_include_directories(Terrain PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ) + Qt6::Core + Qt6::Network + Qt6::Positioning + Utilities +) +target_include_directories(Terrain PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/Terrain/TerrainQuery.cc b/src/Terrain/TerrainQuery.cc index 179e7972d17..d827596f00d 100644 --- a/src/Terrain/TerrainQuery.cc +++ b/src/Terrain/TerrainQuery.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include diff --git a/src/Terrain/TerrainQuery.h b/src/Terrain/TerrainQuery.h index 473b8405b9f..c02a05b91c8 100644 --- a/src/Terrain/TerrainQuery.h +++ b/src/Terrain/TerrainQuery.h @@ -19,7 +19,6 @@ #include #include #include -#include Q_DECLARE_LOGGING_CATEGORY(TerrainQueryLog) Q_DECLARE_LOGGING_CATEGORY(TerrainQueryVerboseLog) diff --git a/src/UTMSP/CMakeLists.txt b/src/UTMSP/CMakeLists.txt index ed605d8a6d8..00105ae855b 100644 --- a/src/UTMSP/CMakeLists.txt +++ b/src/UTMSP/CMakeLists.txt @@ -1,47 +1,58 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) find_package(Threads REQUIRED) +qt_add_library(UTMSP STATIC) + option(CONFIG_UTM_ADAPTER "Enable UTM Adapter" OFF) # TODO: Make this QGC_CONFIG_UTM_ADAPTER if(CONFIG_UTM_ADAPTER) message(STATUS "UTMSP is Initialized") - add_library(UTMSP - UTMSPRestInterface.cpp - UTMSPBlenderRestInterface.cpp + target_sources(UTMSP + PRIVATE + UTMSPAircraft.cpp + UTMSPAircraft.h UTMSPAuthorization.cpp + UTMSPAuthorization.h + UTMSPBlenderRestInterface.cpp + UTMSPBlenderRestInterface.h + UTMSPFlightPlanManager.cpp + UTMSPFlightPlanManager.h + UTMSPManager.cpp + UTMSPManager.h UTMSPNetworkRemoteIDManager.cpp - UTMSPAircraft.cpp + UTMSPNetworkRemoteIDManager.h UTMSPOperator.cpp - UTMSPFlightPlanManager.cpp + UTMSPOperator.h + UTMSPRestInterface.cpp + UTMSPRestInterface.h UTMSPServiceController.cpp + UTMSPServiceController.h UTMSPVehicle.cpp - UTMSPManager.cpp - ) + UTMSPVehicle.h + ) add_custom_target(UTMSPQml SOURCES - UTMSPAdapterEditor.qml - UTMSPMapVisuals.qml - UTMSPActivationStatusBar.qml - ) - + UTMSPActivationStatusBar.qml + UTMSPAdapterEditor.qml + UTMSPMapVisuals.qml + ) else() - # If CONFIG_UTM_ADAPTER is not set, use utmsp_dummy.qrc message(STATUS "UTMSP: Dummy is Initialized") - add_library(UTMSP - dummy/utmsp_dummy.qrc - ) + set(UTMSP_RESOURCES) - target_include_directories(UTMSP PUBLIC dummy) + qt_add_resources(UTMSP_RESOURCES dummy/utmsp_dummy.qrc) + target_sources(UTMSP + PRIVATE + ${UTMSP_RESOURCES} + ) endif() -target_include_directories(UTMSP PUBLIC services ) - target_link_libraries(UTMSP - -PRIVATE + PRIVATE nlohmann_json -PUBLIC + PUBLIC Qt6::Core Qt6::Location Qt6::Widgets @@ -49,4 +60,8 @@ PUBLIC qgc ) -target_include_directories(UTMSP INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(UTMSP + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + services +) diff --git a/src/Utilities/CMakeLists.txt b/src/Utilities/CMakeLists.txt index db172255ab1..61aacf72c35 100644 --- a/src/Utilities/CMakeLists.txt +++ b/src/Utilities/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(Qt6 REQUIRED COMPONENTS Core Positioning Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Network Positioning Qml) qt_add_library(Utilities STATIC JsonHelper.cc @@ -33,10 +33,11 @@ target_link_libraries(Utilities PRIVATE Qt6::Qml shp + qgc PUBLIC Qt6::Core + Qt6::Network Qt6::Positioning - qgc ) target_include_directories(Utilities diff --git a/src/Vehicle/Actuators/CMakeLists.txt b/src/Vehicle/Actuators/CMakeLists.txt index dbe47e87365..0d24be5ace5 100644 --- a/src/Vehicle/Actuators/CMakeLists.txt +++ b/src/Vehicle/Actuators/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_library(Actuators STATIC ActuatorActions.cc @@ -18,6 +19,9 @@ qt_add_library(Actuators STATIC MotorAssignment.h ) -target_link_libraries(Actuators PRIVATE - qgc) +target_link_libraries(Actuators + PRIVATE + qgc +) +target_include_directories(Actuators PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/Vehicle/CMakeLists.txt b/src/Vehicle/CMakeLists.txt index 59e9adb7252..57ff699c85d 100644 --- a/src/Vehicle/CMakeLists.txt +++ b/src/Vehicle/CMakeLists.txt @@ -1,6 +1,7 @@ - add_subdirectory(Actuators) +find_package(Qt6 REQUIRED COMPONENTS Core) + qt_add_library(Vehicle STATIC Autotune.cpp Autotune.h @@ -10,10 +11,10 @@ qt_add_library(Vehicle STATIC CompInfoActuators.h CompInfoEvents.cc CompInfoEvents.h - CompInfoParam.cc - CompInfoParam.h CompInfoGeneral.cc CompInfoGeneral.h + CompInfoParam.cc + CompInfoParam.h ComponentInformationCache.cc ComponentInformationCache.h ComponentInformationManager.cc @@ -38,10 +39,12 @@ qt_add_library(Vehicle STATIC MAVLinkStreamConfig.h MultiVehicleManager.cc MultiVehicleManager.h - StateMachine.cc - StateMachine.h + RemoteIDManager.cc + RemoteIDManager.h StandardModes.cc StandardModes.h + StateMachine.cc + StateMachine.h SysStatusSensorInfo.cc SysStatusSensorInfo.h TerrainFactGroup.cc @@ -52,9 +55,10 @@ qt_add_library(Vehicle STATIC TrajectoryPoints.h UASMessageHandler.cc UASMessageHandler.h + Vehicle.cc + Vehicle.h VehicleBatteryFactGroup.cc VehicleBatteryFactGroup.h - Vehicle.cc VehicleClockFactGroup.cc VehicleClockFactGroup.h VehicleDistanceSensorFactGroup.cc @@ -67,17 +71,16 @@ qt_add_library(Vehicle STATIC VehicleEstimatorStatusFactGroup.h VehicleGeneratorFactGroup.cc VehicleGeneratorFactGroup.h - VehicleLocalPositionFactGroup.cc - VehicleLocalPositionFactGroup.h - VehicleLocalPositionSetpointFactGroup.cc - VehicleLocalPositionSetpointFactGroup.h - VehicleGPSFactGroup.cc - VehicleGPSFactGroup.h VehicleGPS2FactGroup.cc VehicleGPS2FactGroup.h - Vehicle.h + VehicleGPSFactGroup.cc + VehicleGPSFactGroup.h VehicleLinkManager.cc VehicleLinkManager.h + VehicleLocalPositionFactGroup.cc + VehicleLocalPositionFactGroup.h + VehicleLocalPositionSetpointFactGroup.cc + VehicleLocalPositionSetpointFactGroup.h VehicleObjectAvoidance.cc VehicleObjectAvoidance.h VehicleSetpointFactGroup.cc @@ -88,10 +91,8 @@ qt_add_library(Vehicle STATIC VehicleVibrationFactGroup.h VehicleWindFactGroup.cc VehicleWindFactGroup.h - VehicleHygrometerFactGroup.cc - VehicleHygrometerFactGroup.h - RemoteIDManager.h - RemoteIDManager.cc + VehicleHygrometerFactGroup.cc + VehicleHygrometerFactGroup.h ) target_link_libraries(Vehicle @@ -103,7 +104,4 @@ target_link_libraries(Vehicle libevents ) -target_include_directories(Vehicle - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) +target_include_directories(Vehicle PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/VehicleSetup/Bootloader.cc b/src/VehicleSetup/Bootloader.cc index 4171137d2db..08abac92c72 100644 --- a/src/VehicleSetup/Bootloader.cc +++ b/src/VehicleSetup/Bootloader.cc @@ -9,9 +9,12 @@ #include "Bootloader.h" #include "QGCLoggingCategory.h" - +#ifdef Q_OS_ANDROID +#include "qserialport.h" +#else +#include +#endif #include -#include #include #include diff --git a/src/VehicleSetup/CMakeLists.txt b/src/VehicleSetup/CMakeLists.txt index 3ab142a9387..82071323174 100644 --- a/src/VehicleSetup/CMakeLists.txt +++ b/src/VehicleSetup/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) qt_add_library(VehicleSetup STATIC Bootloader.cc @@ -17,11 +18,11 @@ qt_add_library(VehicleSetup STATIC add_custom_target(VehicleSetupQml SOURCES FirmwareUpgrade.qml + JoystickConfig.qml JoystickConfigAdvanced.qml JoystickConfigButtons.qml JoystickConfigCalibration.qml JoystickConfigGeneral.qml - JoystickConfig.qml PX4FlowSensor.qml SetupParameterEditor.qml SetupView.qml @@ -35,4 +36,4 @@ target_link_libraries(VehicleSetup qgc ) -target_include_directories(VehicleSetup INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(VehicleSetup PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/VideoManager/CMakeLists.txt b/src/VideoManager/CMakeLists.txt index a37be635512..91439afe252 100644 --- a/src/VideoManager/CMakeLists.txt +++ b/src/VideoManager/CMakeLists.txt @@ -1,3 +1,5 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Multimedia) + # QGC_DISABLE_UVC qt_add_library(VideoManager STATIC @@ -10,11 +12,11 @@ qt_add_library(VideoManager STATIC ) target_link_libraries(VideoManager + PRIVATE + Qt6::Multimedia PUBLIC qgc - Qt6::Multimedia - Qt6::OpenGL VideoReceiver ) -target_include_directories(VideoManager INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(VideoManager PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/VideoReceiver/CMakeLists.txt b/src/VideoReceiver/CMakeLists.txt index c280e6cdb3e..5350c4e8345 100644 --- a/src/VideoReceiver/CMakeLists.txt +++ b/src/VideoReceiver/CMakeLists.txt @@ -1,21 +1,6 @@ -set(EXTRA_SOURCES) -set(EXTRA_LIBRARIES) - -if (GST_FOUND) - set(EXTRA_SOURCES - gstqgc.c - gstqgcvideosinkbin.c - GStreamer.cc - GStreamer.h - GstVideoReceiver.cc - GstVideoReceiver.h - ) - - set(EXTRA_LIBRARIES qmlglsink ${GST_LINK_LIBRARIES}) -endif() +find_package(Qt6 REQUIRED COMPONENTS Core Multimedia) qt_add_library(VideoReceiver STATIC - ${EXTRA_SOURCES} VideoReceiver.h ) @@ -24,11 +9,25 @@ target_link_libraries(VideoReceiver Qt6::Multimedia Qt6::OpenGL Qt6::Quick - ${EXTRA_LIBRARIES} Utilities ) -target_include_directories(VideoReceiver INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -if (GST_FOUND) - target_include_directories(VideoReceiver PUBLIC ${GST_INCLUDE_DIRS}) +target_include_directories(VideoReceiver PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +if(GST_FOUND) + target_sources(VideoReceiver + PRIVATE + gstqgc.c + gstqgcvideosinkbin.c + GStreamer.cc + GStreamer.h + GstVideoReceiver.cc + GstVideoReceiver.h + ) + + target_link_libraries(VideoReceiver + PUBLIC + qmlglsink + Settings + ) endif() diff --git a/src/Viewer3D/CMakeLists.txt b/src/Viewer3D/CMakeLists.txt index 6dc43e7b8d0..3b61f1c0dff 100644 --- a/src/Viewer3D/CMakeLists.txt +++ b/src/Viewer3D/CMakeLists.txt @@ -1,11 +1,12 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Quick3D) qt_add_library(Viewer3D STATIC + Viewer3DManager.cc CityMapGeometry.cc CityMapGeometry.h earcut.hpp OsmParser.cc OsmParser.h - Viewer3DManager.cc Viewer3DManager.h Viewer3DQmlBackend.cc Viewer3DQmlBackend.h @@ -14,16 +15,10 @@ qt_add_library(Viewer3D STATIC Viewer3DUtils.h ) -find_package(Qt6 REQUIRED COMPONENTS Quick3D) - target_link_libraries(Viewer3D PUBLIC qgc Qt6::Quick3D ) -target_include_directories(Viewer3D - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ) - +target_include_directories(Viewer3D PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt index 40e4416d757..3292f81e330 100644 --- a/src/api/CMakeLists.txt +++ b/src/api/CMakeLists.txt @@ -1,9 +1,14 @@ +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_library(api STATIC QGCCorePlugin.cc + QGCCorePlugin.h QGCOptions.cc + QGCOptions.h QGCSettings.cc + QGCSettings.h QmlComponentInfo.cc + QmlComponentInfo.h ) target_link_libraries(api @@ -12,4 +17,3 @@ target_link_libraries(api ) target_include_directories(api PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) - diff --git a/src/comm/CMakeLists.txt b/src/comm/CMakeLists.txt index b0f43af2012..a1e5902cfe1 100644 --- a/src/comm/CMakeLists.txt +++ b/src/comm/CMakeLists.txt @@ -1,16 +1,6 @@ -# NO_SERIAL_LINK # TODO: Make this QGC_NO_SERIAL_LINK +find_package(Qt6 REQUIRED COMPONENTS Bluetooth Core Network Test) -set(EXTRA_SRC) -if(QGC_BUILD_TESTING) - list(APPEND EXTRA_SRC - MockLink.cc - MockLink.h - MockLinkFTP.cc - MockLinkFTP.h - MockLinkMissionItemHandler.cc - MockLinkMissionItemHandler.h - ) -endif() +# NO_SERIAL_LINK # TODO: Make this QGC_NO_SERIAL_LINK qt_add_library(comm STATIC BluetoothLink.cc @@ -37,21 +27,36 @@ qt_add_library(comm STATIC UdpIODevice.h UDPLink.cc UDPLink.h - - ${EXTRA_SRC} ) +if(QGC_BUILD_TESTING) + target_sources(comm + PRIVATE + MockLink.cc + MockLink.h + MockLinkFTP.cc + MockLinkFTP.h + MockLinkMissionItemHandler.cc + MockLinkMissionItemHandler.h + ) +endif() + target_link_libraries(comm + PRIVATE + Qt6::Test PUBLIC qgc - Qt6::Location - Qt6::SerialPort - Qt6::Test - Qt6::TextToSpeech Qt6::Widgets Qt6::Bluetooth + Qt6::Network ) +if(ANDROID) + target_link_libraries(comm PUBLIC qtandroidserialport) +else() + target_link_libraries(comm PUBLIC Qt6::SerialPort) +endif() + option(QGC_ZEROCONF_ENABLED "Enable ZeroConf Compatibility" OFF) if(QGC_ZEROCONF_ENABLED) target_link_libraries(comm PRIVATE qmdnsengine) diff --git a/src/comm/QGCSerialPortInfo.h b/src/comm/QGCSerialPortInfo.h index 4e30715a58a..861d752b194 100644 --- a/src/comm/QGCSerialPortInfo.h +++ b/src/comm/QGCSerialPortInfo.h @@ -10,6 +10,7 @@ #pragma once +#include #ifdef Q_OS_ANDROID #include "qserialportinfo.h" #else diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 480aecda6cd..cc910de1177 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -1,9 +1,12 @@ add_subdirectory(preferences) add_subdirectory(toolbar) +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + add_custom_target(uiQml SOURCES AppSettings.qml ExitWithErrorWindow.qml MainRootWindow.qml + SettingsPagesModel.qml ) diff --git a/src/ui/preferences/CMakeLists.txt b/src/ui/preferences/CMakeLists.txt index 55a72d6fe61..3d33813124c 100644 --- a/src/ui/preferences/CMakeLists.txt +++ b/src/ui/preferences/CMakeLists.txt @@ -1,19 +1,21 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + add_custom_target(UiPreferencesQml SOURCES - ADSBServerSettings.qml BluetoothSettings.qml - FlyViewSettings.qml GeneralSettings.qml HelpSettings.qml LinkSettings.qml LogReplaySettings.qml - OfflineMapInfo.qml PX4LogTransferSettings.qml - MapSettings.qml - PlanViewSettings.qml SerialSettings.qml TcpSettings.qml - TelemetrySettings.qml UdpSettings.qml + ADSBServerSettings.qml + FlyViewSettings.qml + MapSettings.qml + OfflineMapInfo.qml + PlanViewSettings.qml + TelemetrySettings.qml VideoSettings.qml ) diff --git a/src/ui/toolbar/CMakeLists.txt b/src/ui/toolbar/CMakeLists.txt index 27576894b10..e65202f2ffb 100644 --- a/src/ui/toolbar/CMakeLists.txt +++ b/src/ui/toolbar/CMakeLists.txt @@ -1,9 +1,10 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Qml) + add_custom_target(UiToolbarQml SOURCES ArmedIndicator.qml BatteryIndicator.qml FlightModeMenuIndicator.qml - FlyViewToolBar.qml GPSIndicator.qml GPSIndicatorPage.qml GPSRTKIndicator.qml @@ -13,10 +14,11 @@ add_custom_target(UiToolbarQml MessageIndicator.qml ModeIndicator.qml MultiVehicleSelector.qml - PlanViewToolBar.qml RCRSSIIndicator.qml RemoteIDIndicator.qml RemoteIDIndicatorPage.qml SignalStrength.qml TelemetryRSSIIndicator.qml + FlyViewToolBar.qml + PlanViewToolBar.qml )