diff --git a/.github/workflows/android-linux.yml b/.github/workflows/android-linux.yml
index 6ee800330fc1..67ba9e8cc5a5 100644
--- a/.github/workflows/android-linux.yml
+++ b/.github/workflows/android-linux.yml
@@ -16,6 +16,7 @@ on:
- 'docs/**'
- '.github/workflows/docs_deploy.yml'
- '.github/workflows/linux.yml'
+ - '.github/workflows/ios.yml'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
diff --git a/.github/workflows/android-windows.yml b/.github/workflows/android-windows.yml
index 4851c2025595..46a815f2a644 100644
--- a/.github/workflows/android-windows.yml
+++ b/.github/workflows/android-windows.yml
@@ -15,6 +15,7 @@ on:
- 'deploy/**'
- 'docs/**'
- '.github/workflows/docs_deploy.yml'
+ - '.github/workflows/ios.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
diff --git a/.github/workflows/docker-linux.yml b/.github/workflows/docker-linux.yml
index 0ebabcacbfff..fc07c98f84ef 100644
--- a/.github/workflows/docker-linux.yml
+++ b/.github/workflows/docker-linux.yml
@@ -18,6 +18,7 @@ on:
- 'docs/**'
- '.github/workflows/docs_deploy.yml'
- '.github/workflows/android.yml'
+ - '.github/workflows/ios.yml'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml
index b0f4f0d7f323..b31b176073f9 100644
--- a/.github/workflows/ios.yml
+++ b/.github/workflows/ios.yml
@@ -1,7 +1,26 @@
name: iOS
on:
- workflow_dispatch:
+ push:
+ branches:
+ - master
+ - 'Stable*'
+ tags:
+ - 'v*'
+ paths-ignore:
+ - 'android/**'
+ - 'deploy/**'
+ - 'docs/**'
+ pull_request:
+ paths-ignore:
+ - 'android/**'
+ - 'deploy/**'
+ - 'docs/**'
+ - '.github/workflows/android-*.yml'
+ - '.github/workflows/docs_deploy.yml'
+ - '.github/workflows/*linux.yml'
+ - '.github/workflows/macos.yml'
+ - '.github/workflows/windows.yml'
jobs:
build:
@@ -82,7 +101,6 @@ jobs:
aqtversion: ==3.1.*
host: mac
target: ios
- arch: ios
dir: ${{ runner.temp }}
extra: --autodesktop
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors
@@ -94,8 +112,11 @@ jobs:
working-directory: ${{ runner.temp }}/shadow_build_dir
run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}
+ -DQT_DEBUG_FIND_PACKAGE=ON
+ -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
-DQT_HOST_PATH="${{ env.QT_ROOT_DIR }}/../macos"
-DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }}
+ -DCMAKE_FIND_ROOT_PATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"
- name: Build
working-directory: ${{ runner.temp }}/shadow_build_dir
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 21406644a035..ad77f0bdb422 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -18,6 +18,7 @@ on:
- 'docs/**'
- '.github/workflows/docs_deploy.yml'
- '.github/workflows/android.yml'
+ - '.github/workflows/ios.yml'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 893b72f343e4..aa32be5e0a11 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -18,6 +18,7 @@ on:
- 'docs/**'
- '.github/workflows/docs_deploy.yml'
- '.github/workflows/android.yml'
+ - '.github/workflows/ios.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/windows.yml'
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index 9bb21ce684c0..4ea6534f6236 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -18,6 +18,7 @@ on:
- 'docs/**'
- '.github/workflows/docs_deploy.yml'
- '.github/workflows/android.yml'
+ - '.github/workflows/ios.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/macos.yml'
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 55e04b4947a1..0f705339a915 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 3.22.1)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+if(IOS)
+ set(CMAKE_SYSTEM_NAME iOS)
+ set(CMAKE_OSX_ARCHITECTURES "arm64")
+ set(CMAKE_OSX_SYSROOT "iphoneos")
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
+endif()
+
#######################################################
# Custom Build Configuration
#######################################################
@@ -155,19 +162,16 @@ endif()
find_package(Qt6
REQUIRED
COMPONENTS
- Bluetooth
- Charts
- Concurrent
Core
Core5Compat
Location
Multimedia
Network
+ OpenGL
Positioning
Quick
QuickControls2
QuickWidgets
- OpenGL
Sensors
Sql
Svg
@@ -176,7 +180,11 @@ find_package(Qt6
Widgets
Xml
OPTIONAL_COMPONENTS
+ Bluetooth
+ Concurrent
+ Charts
LinguistTools
+ Quick3D
SerialPort
HINTS
${QT_LIBRARY_HINTS}
@@ -213,8 +221,6 @@ if(QGC_DEBUG_QML)
add_compile_definitions(QT_QML_DEBUG)
endif()
-cmake_dependent_option(QGC_NO_SERIAL_LINK "Build QGroundControl without Serial Support Support." OFF "NOT IOS" ON)
-
if(QGC_DISABLE_APM_MAVLINK)
add_compile_definitions(NO_ARDUPILOT_DIALECT)
endif()
@@ -228,6 +234,12 @@ endif()
cmake_dependent_option(QGC_BUILD_DEPENDENCIES "Force Building of Dependencies." OFF "NOT CMAKE_CROSSCOMPILING;NOT MACOS_UNIVERSAL_BUILD" ON)
+cmake_dependent_option(QGC_NO_SERIAL_LINK "Build QGroundControl without Serial Support Support." OFF "NOT Qt6SerialPort_FOUND" ON)
+cmake_dependent_option(QGC_ENABLE_BLUETOOTH "Enable Viewer3D" ON "NOT Qt6Bluetooth_FOUND" OFF)
+cmake_dependent_option(QGC_DISABLE_VIEWER3D "Disable Viewer3D" OFF "NOT Qt6Quick3D_FOUND" ON) # This removes QtQuick3D which is GPL licensed
+cmake_dependent_option(QGC_DISABLE_MAVLINK_INSPECTOR "Disable Mavlink Inspector" OFF "NOT Qt6Charts_FOUND" ON) # This removes QtCharts which is GPL licensed
+cmake_dependent_option(QGC_DISABLE_CONCURRENT "Disable Qt6Concurrent" OFF "Qt6Concurrent_FOUND" ON) # This removes QtCharts which is GPL licensed
+
#######################################################
# Custom Build Configuration
#######################################################
@@ -365,26 +377,19 @@ elseif(MACOS)
elseif(IOS)
enable_language(OBJC)
- set(CMAKE_OSX_ARCHITECTURES "arm64")
- set(CMAKE_OSX_SYSROOT "iphoneos")
- set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
- set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "14.0")
- set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") # iPhone,iPad
- set(CMAKE_XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/deploy/ios/iOS-Info.plist")
-
set_target_properties(${PROJECT_NAME}
PROPERTIES
+ MACOSX_BUNDLE TRUE
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/deploy/ios/iOS-Info.plist"
+ MACOSX_BUNDLE_BUNDLE_NAME "${CMAKE_PROJECT_NAME}"
+ MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
+ MACOSX_BUNDLE_COPYRIGHT "${QGC_APP_COPYRIGHT}"
+ MACOSX_BUNDLE_GUI_IDENTIFIER "${QGC_BUNDLE_ID}"
+ # MACOSX_BUNDLE_ICON_FILE "macx.icns"
+ MACOSX_BUNDLE_INFO_STRING "${QGC_APP_DESCRIPTION}"
+ MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
+ MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
QT_IOS_LAUNCH_SCREEN ${CMAKE_SOURCE_DIR}/deploy/ios/QGCLaunchScreen.xib
- XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.mavlink.qgroundcontrol"
- XCODE_ATTRIBUTE_PRODUCT_NAME ${CMAKE_PROJECT_NAME}
- XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION ${CMAKE_PROJECT_VERSION}
- XCODE_ATTRIBUTE_MARKETING_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
- XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon"
- XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "14.0"
- XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2" # iPhone,iPad
- XCODE_ATTRIBUTE_INFOPLIST_KEY_CFBundleDisplayName ${CMAKE_PROJECT_NAME}
- XCODE_ATTRIBUTE_INFOPLIST_KEY_LSApplicationCategoryType "public.app-category.mycategory"
- XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES"
)
elseif(ANDROID)
FetchContent_Declare(android_openssl
diff --git a/cmake/FindGStreamer.cmake b/cmake/FindGStreamer.cmake
index ed0b86f947b7..7bb5da0248b4 100644
--- a/cmake/FindGStreamer.cmake
+++ b/cmake/FindGStreamer.cmake
@@ -70,23 +70,24 @@ if(WIN32)
cmake_print_variables(PKG_CONFIG_ARGN)
elseif(MACOS)
set(GSTREAMER_PREFIX "/Library/Frameworks/GStreamer.framework")
+ list(APPEND CMAKE_FRAMEWORK_PATH "/Library/Frameworks")
set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/Versions/Current/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
elseif(LINUX)
set(GSTREAMER_PREFIX "/usr")
set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/pkgconfig:${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu/pkgconfig:$ENV{PKG_CONFIG_PATH}")
elseif(IOS)
- set(GSTREAMER_PREFIX "~/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework")
+ set(GSTREAMER_PREFIX_IOS "~/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework")
+ list(APPEND CMAKE_FRAMEWORK_PATH "/Library/Developer/GStreamer/iPhone.sdk")
if(DEFINED ENV{GSTREAMER_PREFIX_IOS} AND EXISTS $ENV{GSTREAMER_PREFIX_IOS})
set(GSTREAMER_PREFIX_IOS $ENV{GSTREAMER_PREFIX_IOS})
else()
FetchContent_Declare(gstreamer
URL "https://gstreamer.freedesktop.org/data/pkg/ios/${QGC_GST_TARGET_VERSION}/gstreamer-1.0-devel-${QGC_GST_TARGET_VERSION}-ios-universal.pkg"
- DOWNLOAD_EXTRACT_TIMESTAMP true
)
FetchContent_MakeAvailable(gstreamer)
set(GSTREAMER_PREFIX_IOS ${gstreamer_SOURCE_DIR})
endif()
- # TODO: set(GSTREAMER_PREFIX ${GSTREAMER_PREFIX_IOS}/)
+ set(GSTREAMER_PREFIX ${GSTREAMER_PREFIX_IOS})
elseif(ANDROID)
set(GSTREAMER_PREFIX_ANDROID)
if(DEFINED ENV{GSTREAMER_PREFIX_ANDROID} AND EXISTS $ENV{GSTREAMER_PREFIX_ANDROID})
diff --git a/deploy/ios/Info.plist.in b/deploy/ios/Info.plist.in
new file mode 100644
index 000000000000..120dde2ff8bf
--- /dev/null
+++ b/deploy/ios/Info.plist.in
@@ -0,0 +1,52 @@
+
+
+
+
+ CFBundlePackageType
+ APPL
+
+ CFBundleName
+ @MACOSX_BUNDLE_BUNDLE_NAME@
+
+ CFBundleDisplayName
+ @MACOSX_BUNDLE_BUNDLE_NAME@
+
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+
+ CFBundleIdentifier
+ @MACOSX_BUNDLE_GUI_IDENTIFIER@
+
+ CFBundleVersion
+ @MACOSX_BUNDLE_BUNDLE_VERSION@
+
+ CFBundleShortVersionString
+ @MACOSX_BUNDLE_SHORT_VERSION_STRING@
+
+ CFBundleIconFile
+ ${ASSETCATALOG_COMPILER_APPICON_NAME}
+
+ MinimumOSVersion
+ ${IPHONEOS_DEPLOYMENT_TARGET}
+
+ ITSAppUsesNonExemptEncryption
+
+
+ LSRequiresIPhoneOS
+
+
+ NSHighResolutionCapable
+
+
+ UILaunchStoryboardName
+ AppLaunchScreen
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/src/AnalyzeView/CMakeLists.txt b/src/AnalyzeView/CMakeLists.txt
index 4531ad9295b8..f56cdb791165 100644
--- a/src/AnalyzeView/CMakeLists.txt
+++ b/src/AnalyzeView/CMakeLists.txt
@@ -1,4 +1,4 @@
-find_package(Qt6 REQUIRED COMPONENTS Core Charts Gui Qml QmlIntegration)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml QmlIntegration)
qt_add_library(AnalyzeView STATIC
ExifParser.cc
@@ -11,24 +11,16 @@ qt_add_library(AnalyzeView STATIC
LogDownloadController.h
LogEntry.cc
LogEntry.h
- MAVLinkChartController.cc
- MAVLinkChartController.h
MAVLinkConsoleController.cc
MAVLinkConsoleController.h
- MAVLinkInspectorController.cc
- MAVLinkInspectorController.h
- MAVLinkMessage.cc
- MAVLinkMessage.h
- MAVLinkMessageField.cc
- MAVLinkMessageField.h
- MAVLinkSystem.cc
- MAVLinkSystem.h
PX4LogParser.cc
PX4LogParser.h
ULogParser.cc
ULogParser.h
)
+#===========================================================================#
+
include(FetchContent)
FetchContent_Declare(ulogparser
GIT_REPOSITORY https://github.com/PX4/ulog_cpp.git
@@ -39,7 +31,6 @@ FetchContent_MakeAvailable(ulogparser)
target_link_libraries(AnalyzeView
PRIVATE
- Qt6::Charts
Qt6::Gui
Qt6::Qml
ulog_cpp::ulog_cpp
@@ -55,6 +46,33 @@ target_link_libraries(AnalyzeView
QmlControls
)
+#===========================================================================#
+
+if(NOT QGC_DISABLE_MAVLINK_INSPECTOR)
+ find_package(Qt6 REQUIRED COMPONENTS Charts)
+ target_sources(AnalyzeView
+ PRIVATE
+ MAVLinkChartController.cc
+ MAVLinkChartController.h
+ MAVLinkInspectorController.cc
+ MAVLinkInspectorController.h
+ MAVLinkMessage.cc
+ MAVLinkMessage.h
+ MAVLinkMessageField.cc
+ MAVLinkMessageField.h
+ MAVLinkSystem.cc
+ MAVLinkSystem.h
+ )
+ target_link_libraries(AnalyzeView
+ PRIVATE
+ Qt6::Charts
+ )
+else()
+ target_compile_definitions(AnalyzeView PUBLIC QGC_DISABLE_MAVLINK_INSPECTOR)
+endif()
+
+#===========================================================================#
+
set(MINIMUM_EXIV2_VERSION 0.28.3)
if(NOT QGC_BUILD_DEPENDENCIES)
@@ -113,6 +131,8 @@ if(NOT Exiv2_FOUND)
)
endif()
+#===========================================================================#
+
include(FetchContent)
FetchContent_Declare(easyexif
GIT_REPOSITORY https://github.com/mayanklahiri/easyexif.git
@@ -133,6 +153,8 @@ target_include_directories(AnalyzeView
${easyexif_SOURCE_DIR}
)
+#===========================================================================#
+
# qt_add_qml_module(AnalyzeView
# URI QGroundControl.AnalyzeView
# VERSION 1.0
diff --git a/src/Comms/CMakeLists.txt b/src/Comms/CMakeLists.txt
index e7369f7728f1..004990974ca5 100644
--- a/src/Comms/CMakeLists.txt
+++ b/src/Comms/CMakeLists.txt
@@ -74,7 +74,6 @@ endif()
############# Bluetooth
-option(QGC_ENABLE_BLUETOOTH "Enable Bluetooth Links" ON)
if(QGC_ENABLE_BLUETOOTH)
find_package(Qt6 REQUIRED COMPONENTS Bluetooth)
target_link_libraries(Comms PUBLIC Qt6::Bluetooth)
diff --git a/src/GPS/GPSProvider.cc b/src/GPS/GPSProvider.cc
index 01c5f9d8b4e8..a2e79c5ddf70 100644
--- a/src/GPS/GPSProvider.cc
+++ b/src/GPS/GPSProvider.cc
@@ -19,7 +19,7 @@
#ifdef Q_OS_ANDROID
#include "qserialport.h"
#else
-#include
+#include
#endif
#define GPS_RECEIVE_TIMEOUT 1200
diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc
index fbdb956f99d7..75df1fba5011 100644
--- a/src/QGCApplication.cc
+++ b/src/QGCApplication.cc
@@ -80,7 +80,9 @@
#include "ShapeFileHelper.h"
#include "QGCFileDownload.h"
#include "MAVLinkConsoleController.h"
+#if !defined(QGC_DISABLE_MAVLINK_INSPECTOR)
#include "MAVLinkChartController.h"
+#endif
#include "GeoTagController.h"
#include "LogReplayLink.h"
#include "VehicleObjectAvoidance.h"
@@ -98,9 +100,9 @@
#include "AudioOutput.h"
#include "FollowMe.h"
#include "JsonHelper.h"
-// #ifdef QGC_VIEWER3D
+#ifndef QGC_DISABLE_VIEWER3D
#include "Viewer3DManager.h"
-// #endif
+#endif
#include "GimbalController.h"
#ifndef NO_SERIAL_LINK
#include "FirmwareUpgradeController.h"
@@ -340,10 +342,9 @@ void QGCApplication::init()
qmlRegisterSingletonType("QGroundControl", 1, 0, "QGroundControl", qgroundcontrolQmlGlobalSingletonFactory);
qmlRegisterSingletonType ("QGroundControl.ScreenToolsController", 1, 0, "ScreenToolsController", screenToolsControllerSingletonFactory);
-
- // #ifdef QGC_VIEWER3D
+#ifndef QGC_DISABLE_VIEWER3D
Viewer3DManager::registerQmlTypes();
- // #endif
+#endif
qmlRegisterUncreatableType ("QGroundControl.Vehicle", 1, 0, "Autotune", "Reference only");
qmlRegisterUncreatableType ("QGroundControl.Vehicle", 1, 0, "RemoteIDManager", "Reference only");
diff --git a/src/QmlControls/AppMessages.cc b/src/QmlControls/AppMessages.cc
index 6e31f96675df..53eeeee62c91 100644
--- a/src/QmlControls/AppMessages.cc
+++ b/src/QmlControls/AppMessages.cc
@@ -68,7 +68,9 @@ void AppLogModel::writeMessages(const QString dest_file)
{
const QString writebuffer(stringList().join('\n').append('\n'));
+#ifndef QGC_DISABLE_CONCURRENT
QFuture future = QtConcurrent::run([dest_file, writebuffer] {
+#endif
emit debug_model->writeStarted();
bool success = false;
QFile file(dest_file);
@@ -80,7 +82,9 @@ void AppLogModel::writeMessages(const QString dest_file)
qWarning() << "AppLogModel::writeMessages write failed:" << file.errorString();
}
emit debug_model->writeFinished(success);
+#ifndef QGC_DISABLE_CONCURRENT
});
+#endif
}
void AppLogModel::log(const QString message)
diff --git a/src/QmlControls/CMakeLists.txt b/src/QmlControls/CMakeLists.txt
index 8bbdbbfdd2e8..927b51fdf337 100644
--- a/src/QmlControls/CMakeLists.txt
+++ b/src/QmlControls/CMakeLists.txt
@@ -1,4 +1,4 @@
-find_package(Qt6 REQUIRED COMPONENTS Concurrent Core Gui Location Positioning Qml QmlIntegration Quick Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Location Positioning Qml QmlIntegration Quick Widgets OPTIONAL_COMPONENTS Concurrent)
if(QGC_UTM_ADAPTER)
add_definitions(-DQGC_UTM_ADAPTER)
@@ -66,7 +66,6 @@ qt_add_library(QmlControls STATIC
target_link_libraries(QmlControls
PRIVATE
- Qt6::Concurrent
Qt6::Location
FirmwarePlugin
Geo
@@ -97,6 +96,12 @@ target_link_libraries(QmlControls
VideoManager
)
+if(Qt6Concurrent_FOUND AND NOT QGC_DISABLE_CONCURRENT)
+ target_link_libraries(QmlControls PRIVATE Qt6::Concurrent)
+else()
+ target_compile_definitions(QGC_DISABLE_CONCURRENT)
+endif()
+
target_include_directories(QmlControls PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# file(GLOB_RECURSE QML_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.qml)
diff --git a/src/Viewer3D/CMakeLists.txt b/src/Viewer3D/CMakeLists.txt
index 2a17d092f802..efc4f6902b2e 100644
--- a/src/Viewer3D/CMakeLists.txt
+++ b/src/Viewer3D/CMakeLists.txt
@@ -2,12 +2,10 @@ find_package(Qt6 REQUIRED COMPONENTS Core)
qt_add_library(Viewer3D STATIC)
-find_package(Qt6 COMPONENTS Quick3D)
-cmake_dependent_option(QGC_VIEWER3D "Enable Viewer3D" ON "Qt6Quick3D_FOUND" OFF)
-if(QGC_VIEWER3D)
+if(NOT QGC_DISABLE_VIEWER3D)
message(STATUS "Viewer3D is Initialized")
- find_package(Qt6 REQUIRED COMPONENTS Core Gui Network Positioning Qml Quick3D Xml)
+ find_package(Qt6 REQUIRED COMPONENTS Gui Network Positioning Qml Quick3D Xml)
target_sources(Viewer3D
PRIVATE
@@ -51,42 +49,42 @@ if(QGC_VIEWER3D)
)
target_include_directories(Viewer3D PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+else()
+ target_compile_definitions(Viewer3D PUBLIC QGC_DISABLE_VIEWER3D)
+endif()
- target_compile_definitions(Viewer3D PUBLIC QGC_VIEWER3D)
-
- # file(GLOB_RECURSE QML_SOURCES RELATIVE Viewer3DQml Viewer3DQml/*.qml)
- # file(GLOB_RECURSE QML_RESOURCES RELATIVE Viewer3DQml Viewer3DQml/*.mesh)
- # qt_add_qml_module(Viewer3D
- # URI QGroundControl.Viewer3D
- # VERSION 1.0
- # QML_FILES ${QML_SOURCES}
- # OUTPUT_TARGETS Viewer3D_targets
- # RESOURCES
- # Images/city_3d_map_icon.svg
- # SampleOsmMap/map_sim_small.osm
- # Shaders/earthMaterial.frag
- # Shaders/earthMaterial.vert
- # ${QML_RESOURCES}
- # IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY}
- # IMPORTS
- # QtQuick
- # QtQuick.Controls
- # QtQuick.Dialogs
- # QtQuick.Layouts
- # QtQuick3D
- # QtPositioning
+# file(GLOB_RECURSE QML_SOURCES RELATIVE Viewer3DQml Viewer3DQml/*.qml)
+# file(GLOB_RECURSE QML_RESOURCES RELATIVE Viewer3DQml Viewer3DQml/*.mesh)
+# qt_add_qml_module(Viewer3D
+# URI QGroundControl.Viewer3D
+# VERSION 1.0
+# QML_FILES ${QML_SOURCES}
+# OUTPUT_TARGETS Viewer3D_targets
+# RESOURCES
+# Images/city_3d_map_icon.svg
+# SampleOsmMap/map_sim_small.osm
+# Shaders/earthMaterial.frag
+# Shaders/earthMaterial.vert
+# ${QML_RESOURCES}
+# IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY}
+# IMPORTS
+# QtQuick
+# QtQuick.Controls
+# QtQuick.Dialogs
+# QtQuick.Layouts
+# QtQuick3D
+# QtPositioning
- # QGroundControl
- # QGroundControl.Controls
- # QGroundControl.Controllers
- # QGroundControl.FactSystem
- # QGroundControl.FlightDisplay
- # QGroundControl.FlightMap
- # QGroundControl.Palette
- # QGroundControl.ScreenTools
- # QGroundControl.Vehicle
+# QGroundControl
+# QGroundControl.Controls
+# QGroundControl.Controllers
+# QGroundControl.FactSystem
+# QGroundControl.FlightDisplay
+# QGroundControl.FlightMap
+# QGroundControl.Palette
+# QGroundControl.ScreenTools
+# QGroundControl.Vehicle
- # QGroundControl.Viewer3D
- # Viewer3D.Models3D
- # )
-endif()
+# QGroundControl.Viewer3D
+# Viewer3D.Models3D
+# )
diff --git a/src/pch.h b/src/pch.h
index ff5d176f8167..a065bfb61cfa 100644
--- a/src/pch.h
+++ b/src/pch.h
@@ -8,8 +8,12 @@
****************************************************************************/
#ifdef __cplusplus
+#ifndef QGC_ENABLE_BLUETOOTH
#include
+#endif
+#ifndef QGC_DISABLE_MAVLINK_INSPECTOR
#include
+#endif
#include
#include
#include
diff --git a/test/Comms/QGCSerialPortInfoTest.cc b/test/Comms/QGCSerialPortInfoTest.cc
index add26ffbff53..a0e6d8525235 100644
--- a/test/Comms/QGCSerialPortInfoTest.cc
+++ b/test/Comms/QGCSerialPortInfoTest.cc
@@ -14,7 +14,9 @@
void QGCSerialPortInfoTest::_testLoadJsonData()
{
+#ifndef NO_SERIAL_LINK
QVERIFY(!QGCSerialPortInfo::_jsonLoaded);
QGCSerialPortInfo::_loadJsonData();
QVERIFY(QGCSerialPortInfo::_jsonLoaded);
+#endif
}
diff --git a/test/UnitTestList.cc b/test/UnitTestList.cc
index 62476b9e8f91..64ba2568a6bc 100644
--- a/test/UnitTestList.cc
+++ b/test/UnitTestList.cc
@@ -125,7 +125,9 @@ int runTests(bool stress, QStringView unitTestOptions)
// UT_REGISTER_TEST(RadioConfigTest)
// Comms
+#ifndef NO_SERIAL_LINK
UT_REGISTER_TEST(QGCSerialPortInfoTest)
+#endif
// FactSystem
UT_REGISTER_TEST(FactSystemTestGeneric)