diff --git a/.clang-format b/.clang-format index e1345f284b5..5649307e105 100644 --- a/.clang-format +++ b/.clang-format @@ -1,17 +1,3 @@ ---- BasedOnStyle: Google -AccessModifierOffset: -4 -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Inline -AllowShortLambdasOnASingleLine: Inline -BinPackArguments: false -BinPackParameters: false ColumnLimit: 120 -IncludeBlocks: Preserve IndentWidth: 4 -Language: Cpp -PackConstructorInitializers: Never -PenaltyBreakAssignment: 80 -SortIncludes: true -SpacesBeforeTrailingComments: 1 -Standard: c++17 diff --git a/.clang-tidy b/.clang-tidy index b9925b48bb8..5e2e27df0e1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,39 +1,5 @@ --- Checks: > - clang-diagnostic-*, clang-analyzer-*, - bugprone-*, - cppcoreguidelines-*, - google-*, - llvm-*, - misc-*, - modernize-*, - performance-*, - portability-*, - readability-*, - -bugprone-easily-swappable-parameters, - -cppcoreguidelines-avoid-c-arrays, - -cppcoreguidelines-avoid-const-or-ref-data-members, - -cppcoreguidelines-avoid-non-const-global-variables, - -cppcoreguidelines-non-private-member-variables-in-classes, - -cppcoreguidelines-pro-type-reinterpret-cast, - -cppcoreguidelines-pro-type-static-cast-downcast, - -cppcoreguidelines-pro-type-vararg, - -cppcoreguidelines-special-member-functions, - -google-readability-todo, - -llvm-header-guard, - -llvm-include-order, - -misc-include-cleaner, - -misc-no-recursion, - -misc-non-private-member-variables-in-classes, - -misc-use-internal-linkage, - -modernize-avoid-c-arrays, - -modernize-use-trailing-return-type, - -readability-convert-member-functions-to-static, - -readability-function-cognitive-complexity, - -readability-identifier-length, - -readability-redundant-access-specifiers, - -readability-uppercase-literal-suffix WarningsAsErrors: '*' -HeaderFilterRegex: '^((?!vendor).)*$' ... diff --git a/.cmake-format b/.cmake-format index ca863a20680..ec4bf6fab11 100644 --- a/.cmake-format +++ b/.cmake-format @@ -1,3 +1,6 @@ -format: - tab_size: 4 - line_width: 100 +--- +line_width: 120 +tab_size: 4 +max_prefix_chars: 40 +use_tabchars: false +... diff --git a/.dockerignore b/.dockerignore index 724cfc15826..0df659476f9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,7 @@ # Ignore Git repository files .git .gitignore +.gitattributes # Ignore node_modules or other build artifacts node_modules @@ -10,8 +11,4 @@ build Dockerfile* docker-compose.yml -# Ignore OS-specific files -.DS_Store -*.swp - -CMakeLists.txt.user* +README.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4122b57d746..5ace4600a1f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,6 @@ version: 2 updates: - - package-ecosystem: github-actions - directory: / + - package-ecosystem: "github-actions" + directory: "/" schedule: - interval: daily - groups: - github-actions: - patterns: - - '*' - open-pull-requests-limit: 5 + interval: "weekly" diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml new file mode 100644 index 00000000000..c412066f3c5 --- /dev/null +++ b/.github/workflows/clang-format-check.yml @@ -0,0 +1,20 @@ +name: clang-format Check + +on: [workflow_dispatch] + +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + strategy: + matrix: + path: + - 'src' + - 'test' + steps: + - uses: actions/checkout@v4 + - name: Run clang-format style check for C++ Source Files. + uses: jidicula/clang-format-action@main + with: + clang-format-version: '17' + check-path: ${{ matrix.path }} diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml new file mode 100644 index 00000000000..f3792510806 --- /dev/null +++ b/.github/workflows/flatpak.yml @@ -0,0 +1,31 @@ +name: flatpak +on: [workflow_dispatch] +jobs: + flatpak-builder: + name: Flatpak + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:gnome-47 + options: --privileged + strategy: + matrix: + arch: [x86_64, aarch64] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - name: Install deps + if: ${{ matrix.arch != 'x86_64' }} + run: | + dnf -y install docker + - name: Set up QEMU + if: ${{ matrix.arch != 'x86_64' }} + id: qemu + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: org.mavlink.qgroundcontrol.flatpak + manifest-path: ./deploy/flatpak/org.mavlink.qgroundcontrol.yml + cache-key: flatpak-builder-${{ github.sha }} + arch: ${{ matrix.arch }} diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml new file mode 100644 index 00000000000..50220d543d5 --- /dev/null +++ b/.github/workflows/spelling.yml @@ -0,0 +1,11 @@ +name: Typos +on: [workflow_dispatch] +jobs: + typos: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + - name: Check spelling + uses: crate-ci/typos@master diff --git a/CMakeLists.txt b/CMakeLists.txt index 774dce8de81..22f939ab6f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,59 +1,33 @@ cmake_minimum_required(VERSION 3.22.1) -list(APPEND CMAKE_MODULE_PATH - ${CMAKE_SOURCE_DIR}/cmake - ${CMAKE_SOURCE_DIR}/cmake/modules - ${CMAKE_SOURCE_DIR}/cmake/find-modules -) +variable_watch(CMAKE_CROSSCOMPILING) ####################################################### -# Custom Build Configuration +# CMake Pre Target Configuration Options ####################################################### -include(CustomOptions) - -if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/custom) - message(STATUS "Enabling custom build") - set(QGC_CUSTOM_BUILD ON) - list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/custom/cmake) - include(CustomOverrides) -endif() - -####################################################### -# Project Info -####################################################### - -# set(CMAKE_OSX_ARCHITECTURES "arm64") -# set(CMAKE_OSX_SYSROOT "iphoneos") -if(APPLE AND NOT IOS) - set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") +# https://cmake.org/cmake/help/latest/policy/CMP0168.html#policy:CMP0168 +if(POLICY CMP0168) + cmake_policy(SET CMP0168 NEW) + set(CMAKE_POLICY_DEFAULT_CMP0168 NEW) endif() -include(Git) +# https://cmake.org/cmake/help/latest/policy/CMP0075.html#policy:CMP0075 +# if(POLICY CMP0075) +# cmake_policy(SET CMP0075 NEW) +# set(CMAKE_POLICY_DEFAULT_CMP0075 NEW) +# endif() -project(${QGC_APP_NAME} - VERSION ${QGC_APP_VERSION} - DESCRIPTION ${QGC_APP_DESCRIPTION} - HOMEPAGE_URL "https://qgroundcontrol.com/" - LANGUAGES C CXX +list(APPEND CMAKE_MODULE_PATH + ${CMAKE_SOURCE_DIR}/cmake + ${CMAKE_SOURCE_DIR}/cmake/modules + ${CMAKE_SOURCE_DIR}/cmake/find-modules ) -if(UNIX AND NOT APPLE AND NOT ANDROID) - set(LINUX TRUE) -endif() - -if(APPLE AND NOT IOS) - set(MACOS TRUE) -endif() - -####################################################### -# CMake Configuration Options -####################################################### - -include(GNUInstallDirs) include(CMakeDependentOption) include(FetchContent) include(CMakePrintHelpers) +# include(CPM) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -62,16 +36,11 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_INCLUDE_CURRENT_DIR OFF) +set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) # set(CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG ON) -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release") -endif() - if(LINUX) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/AppDir/usr) else() @@ -95,55 +64,112 @@ elseif(WIN32) set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_PROGRAM}) set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_PROGRAM}) endif() - if(MSVC) - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") - string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") - elseif(CMAKE_BUILD_TYPE STREQUAL "Release") - string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") - string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") - endif() - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded) - if(POLICY CMP0141) - cmake_policy(SET CMP0141 NEW) - endif() - endif() endif() -if(CMAKE_CROSSCOMPILING AND ANDROID) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) +# if(MSVC) +# if(POLICY CMP0141) +# cmake_policy(SET CMP0141 NEW) +# set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded) +# else() +# if(CMAKE_BUILD_TYPE STREQUAL "Debug") +# string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") +# string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") +# elseif(CMAKE_BUILD_TYPE STREQUAL "Release") +# string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") +# string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +# endif() +# endif() + +# find_program(ccache_exe ccache) +# if(ccache_exe) +# file(COPY_FILE +# ${ccache_exe} ${CMAKE_BINARY_DIR}/cl.exe +# ONLY_IF_DIFFERENT) + +# # By default Visual Studio generators will use /Zi which is not compatible +# # with ccache, so tell Visual Studio to use /Z7 instead. +# message(STATUS "Setting MSVC debug information format to 'Embedded'") +# set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") + +# set(CMAKE_VS_GLOBALS +# "CLToolExe=cl.exe" +# "CLToolPath=${CMAKE_BINARY_DIR}" +# "UseMultiToolTask=true" +# "DebugInformationFormat=OldStyle" +# ) +# endif() +# endif() + +set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: Debug, Release, RelWithDebInfo") +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo") +if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}' (required Debug, Release, RelWithDebInfo)") endif() -set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) +if(QGC_USE_IWYU) + include(IWYU) +endif() -# https://cmake.org/cmake/help/latest/policy/CMP0168.html#policy:CMP0168 -if(POLICY CMP0168) - cmake_policy(SET CMP0168 NEW) - set(CMAKE_POLICY_DEFAULT_CMP0168 NEW) +include(Git) + +####################################################### +# Custom Build Configuration +####################################################### + +include(CustomOptions) + +if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/custom) + message(STATUS "Enabling custom build") + set(QGC_CUSTOM_BUILD ON) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/custom/cmake) + include(CustomOverrides) endif() -# https://cmake.org/cmake/help/latest/policy/CMP0075.html#policy:CMP0075 -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) - set(CMAKE_POLICY_DEFAULT_CMP0075 NEW) +####################################################### +# Project Info +####################################################### + +# set(CMAKE_OSX_ARCHITECTURES "arm64") +# set(CMAKE_OSX_SYSROOT "iphoneos") +# if(APPLE AND NOT IOS) +# set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") +# endif() + +project(${QGC_APP_NAME} + VERSION ${QGC_APP_VERSION} + DESCRIPTION ${QGC_APP_DESCRIPTION} + HOMEPAGE_URL "https://qgroundcontrol.com/" + LANGUAGES C CXX +) + +if(UNIX AND NOT APPLE AND NOT ANDROID) + set(LINUX TRUE) endif() -if(QGC_USE_IWYU) - include(IWYU) +if(APPLE AND NOT IOS) + set(MACOS TRUE) +endif() + +if(APPLE) + enable_language(OBJC) endif() ####################################################### -# Qt6 Configuration +# CMake Post Target Configuration Options ####################################################### -if(CMAKE_CROSSCOMPILING AND NOT IS_DIRECTORY ${QT_HOST_PATH}) - message(FATAL_ERROR "You need to set QT_HOST_PATH to cross compile Qt.") +if(CMAKE_CROSSCOMPILING AND ANDROID) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) endif() -set(QT_SILENCE_MISSING_DEPENDENCY_TARGET_WARNING ON) -set(QT_MINIMUM_VERSION 6.8.1) +# include(CheckSymbolExists) +# set(CMAKE_REQUIRED_LIBRARIES "OpenGl") + +####################################################### +# Qt6 Configuration +####################################################### find_program(QMAKE_EXECUTABLE NAMES qmake HINTS ${QT_ROOT_DIR} ${QTDIR} ENV QTDIR PATH_SUFFIXES bin) execute_process(COMMAND ${QMAKE_EXECUTABLE} -query QT_VERSION OUTPUT_VARIABLE QT_VERSION) @@ -151,92 +177,47 @@ if(QT_VERSION LESS QT_MINIMUM_VERSION) MESSAGE(FATAL_ERROR "Minimum supported Qt version: ${QT_MINIMUM_VERSION}. Installed version: ${QT_VERSION}") endif() - -include(Qt6QGCConfiguration) - -set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml" CACHE PATH "Install path for QML" FORCE) -set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/qml ${CMAKE_BINARY_DIR}/imports CACHE STRING "Extra QML Import Paths" FORCE) add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x060700) -if(CMAKE_BUILD_TYPE STREQUAL "Release") - add_compile_definitions( - NDEBUG - QT_NO_DEBUG - QT_NO_DEBUG_OUTPUT - ) -elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(ENABLE_TESTING ON) - enable_testing() - include(CTest) - - # set(QT_ENABLE_VERBOSE_DEPLOYMENT ON CACHE BOOL "Verbose Deployment") -endif() - -if(ANDROID) - cmake_print_variables(QT_ANDROID_APPLICATION_ARGUMENTS QT_HOST_PATH) - - # set(QT_USE_TARGET_ANDROID_BUILD_DIR ON CACHE BOOL "Use Target Android Build Dir" FORCE) - - list(APPEND QT_ANDROID_MULTI_ABI_FORWARD_VARS QGC_STABLE_BUILD) - list(APPEND QT_ANDROID_MULTI_ABI_FORWARD_VARS QT_HOST_PATH) - cmake_print_variables(QT_ANDROID_MULTI_ABI_FORWARD_VARS) - # QT_ANDROID_DEPLOY_RELEASE - # set(QT_ANDROID_DEPLOYMENT_TYPE ON CACHE BOOL "Deployment Type") - cmake_dependent_option(QT_ANDROID_SIGN_APK "Enable Signing APK" ON "CMAKE_BUILD_TYPE STREQUAL Release" OFF) - if(QT_ANDROID_SIGN_AAB) - message(STATUS "Signing AAB") - endif() - if(QT_ANDROID_SIGN_APK) - message(STATUS "Signing APK") - endif() - # message(STATUS "QT_ANDROID_KEYSTORE_PATH $ENV{QT_ANDROID_KEYSTORE_PATH}") - # message(STATUS "QT_ANDROID_KEYSTORE_ALIAS $ENV{QT_ANDROID_KEYSTORE_ALIAS}") - # QT_ANDROID_KEYSTORE_STORE_PASS, QT_ANDROID_KEYSTORE_KEY_PASS -endif() - find_package(Qt6 - ${QT_MINIMUM_VERSION} - REQUIRED + ${QT_MINIMUM_VERSION}...${QT_MAXIMUM_VERSION} COMPONENTS + Bluetooth + Charts Concurrent Core Core5Compat + LinguistTools Location Multimedia + MultimediaQuickPrivate Network OpenGL Positioning Qml QmlIntegration Quick + Quick3D + Quick3DTools QuickControls2 QuickWidgets Sensors + SerialPort Sql Svg + Test TextToSpeech Widgets Xml - OPTIONAL_COMPONENTS - Bluetooth - Charts - LinguistTools - MultimediaQuickPrivate - Quick3D - Quick3DTools - SerialPort - Test - HINTS - ${QT_LIBRARY_HINTS} ) -if(LINUX) +if(LINUX OR MACOS) find_package(Qt6 ${QT_MINIMUM_VERSION} COMPONENTS WaylandClient) endif() qt_standard_project_setup( REQUIRES ${QT_MINIMUM_VERSION} - SUPPORTS_UP_TO ${QT_MINIMUM_VERSION} + SUPPORTS_UP_TO ${QT_MAXIMUM_VERSION} I18N_SOURCE_LANGUAGE en ) @@ -248,29 +229,68 @@ qt_policy( SET QTP0005 NEW ) +if(CMAKE_BUILD_TYPE STREQUAL "Release") + add_compile_definitions( + NDEBUG + QT_NO_DEBUG + QT_NO_DEBUG_OUTPUT + # QT_NO_DEBUG_OUTPUT + # QT_NO_INFO_OUTPUT + # QT_NO_WARNING_OUTPUT + ) +endif() + +if(CMAKE_CROSSCOMPILING AND NOT IS_DIRECTORY ${QT_HOST_PATH}) + message(FATAL_ERROR "You need to set QT_HOST_PATH to cross compile Qt.") +endif() + +if(MACOS) + if("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64;x86_64" OR "${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64;arm64") + set(QGC_MACOS_UNIVERSAL_BUILD ON) + endif() +elseif(ANDROID) + list(APPEND QT_ANDROID_MULTI_ABI_FORWARD_VARS + QGC_STABLE_BUILD + QT_HOST_PATH + ) +endif() + +# SET(ENV{QT_MESSAGE_PATTERN} "[%{time process} %{type}] %{appname} %{category} %{function} - %{message}") + +# set(ENV{QT_FATAL_WARNINGS} ON) +# set(ENV{QT_DEBUG_PLUGINS} ON) +# set(ENV{QML_IMPORT_TRACE} ON) +# SET(ENV{QT_HASH_SEED} 1234) +# SET(ENV{QT_WIN_DEBUG_CONSOLE} new) + ####################################################### # QGroundControl Options ####################################################### +add_compile_definitions( + QGC_APP_NAME="${QGC_APP_NAME}" + QGC_ORG_NAME="${QGC_ORG_NAME}" + QGC_ORG_DOMAIN="${QGC_ORG_DOMAIN}" + QGC_APP_VERSION="${QGC_APP_VERSION}" + QGC_APP_TAG="${QGC_APP_TAG}" + QGC_SETTINGS_VERSION=${QGC_SETTINGS_VERSION} +) + if(NOT QGC_STABLE_BUILD) add_compile_definitions(QGC_DAILY_BUILD) endif() -cmake_dependent_option(QGC_BUILD_TESTING "Enable testing" ON "CMAKE_BUILD_TYPE STREQUAL Debug" OFF) -if(QGC_BUILD_TESTING) - add_compile_definitions(QGC_UNITTEST_BUILD) -else() - set(BUILD_TESTING OFF CACHE INTERNAL "") -endif() +cmake_dependent_option(QGC_BUILD_TESTING "Enable testing" OFF "CMAKE_BUILD_TYPE STREQUAL Debug" OFF) -# option(QGC_DISABLE_MAVLINK_INSPECTOR "Disable Mavlink Inspector" OFF) # This removes QtCharts which is GPL licensed - -cmake_dependent_option(QGC_DEBUG_QML "Build QGroundControl with QML debugging/profiling support." OFF "CMAKE_BUILD_TYPE STREQUAL Debug" OFF) -if(QGC_DEBUG_QML) - message(STATUS "To enable the QML debugger/profiler, run with: '-qmljsdebugger=port:1234'") +cmake_dependent_option(QT_QML_DEBUG "Build QGroundControl with QML debugging support." OFF "CMAKE_BUILD_TYPE STREQUAL Debug" OFF) +if(QT_QML_DEBUG) add_compile_definitions(QT_QML_DEBUG) endif() +if(QML_IMPORT_TRACE) + set(ENV{QML_IMPORT_TRACE} ON) +endif() + if(QGC_DISABLE_APM_MAVLINK) add_compile_definitions(QGC_NO_ARDUPILOT_DIALECT) endif() @@ -279,15 +299,10 @@ if(QGC_VIEWER3D) add_compile_definitions(QGC_VIEWER3D) endif() -if("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64;x86_64" OR "${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64;arm64") - set(MACOS_UNIVERSAL_BUILD ON CACHE INTERNAL "" FORCE) +if(CMAKE_CROSSCOMPILING OR QGC_MACOS_UNIVERSAL_BUILD) + set(QGC_BUILD_DEPENDENCIES ON CACHE BOOL "Required when Cross Compiling" FORCE) endif() -# TODO: Force building dependencies if(NOT CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL CMAKE_SYSTEM_PROCESSOR)? -# if(CMAKE_OSX_ARCHITECTURES AND NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" IN_LIST CMAKE_OSX_ARCHITECTURES) - -cmake_dependent_option(QGC_BUILD_DEPENDENCIES "Force Building of Dependencies." OFF "NOT CMAKE_CROSSCOMPILING;NOT MACOS_UNIVERSAL_BUILD" ON) - ####################################################### # Custom Build Configuration ####################################################### @@ -332,6 +347,7 @@ endif() ####################################################### qt_add_executable(${CMAKE_PROJECT_NAME} + WIN32 MACOSX_BUNDLE src/main.cc ${QGC_RESOURCES} ) @@ -392,18 +408,17 @@ if(WIN32) target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${QGC_INSTALLER_SOURCE_WIN_FILES}) set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES - WIN32_EXECUTABLE TRUE - QT_TARGET_RC_ICONS "${QGC_WINDOWS_ICON_PATH}" + # WIN32_EXECUTABLE TRUE + # QT_TARGET_RC_ICONS "${QGC_WINDOWS_ICON_PATH}" ) add_compile_definitions(_USE_MATH_DEFINES) elseif(MACOS) - set(MACOSX_BUNDLE_ICON_FILE "macx.icns") set(app_icon_macos "${QGC_MACOS_ICON_PATH}/macx.icns") set_source_files_properties(${app_icon_macos} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") - target_sources(${PROJECT_NAME} PRIVATE ${app_icon_macos}) - set_target_properties(${PROJECT_NAME} + target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${app_icon_macos}) + set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES - MACOSX_BUNDLE TRUE + # MACOSX_BUNDLE TRUE MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/deploy/macos/MacOSXBundleInfo.plist.in" MACOSX_BUNDLE_BUNDLE_NAME "${CMAKE_PROJECT_NAME}" MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}" @@ -415,12 +430,18 @@ elseif(MACOS) MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}" ) elseif(IOS) - enable_language(OBJC) - 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") + # MACOSX_BUNDLE_GUI_IDENTIFIER + # XCODE_ATTRIBUTE_DEVELOPMENT_TEAM + # XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER + + # CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY + # CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE + # CMAKE_XCODE_ATTRIBUTE_BUNDLE_DISPLAY_NAME + set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES QT_IOS_LAUNCH_SCREEN ${CMAKE_SOURCE_DIR}/deploy/ios/QGCLaunchScreen.xib @@ -437,7 +458,7 @@ elseif(IOS) ) # set(QT_NO_FFMPEG_XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON) - # qt_add_ios_ffmpeg_libraries(CMAKE_PROJECT_NAME) + qt_add_ios_ffmpeg_libraries(CMAKE_PROJECT_NAME) elseif(ANDROID) include(CPM) CPMAddPackage( @@ -476,14 +497,6 @@ elseif(LINUX) endif() -add_compile_definitions( - QGC_APP_NAME="${QGC_APP_NAME}" - QGC_ORG_NAME="${QGC_ORG_NAME}" - QGC_ORG_DOMAIN="${QGC_ORG_DOMAIN}" - QGC_APP_VERSION_STR="${QGC_APP_VERSION_STR}" - QGC_SETTINGS_VERSION=${QGC_SETTINGS_VERSION} -) - add_subdirectory(src) target_link_libraries(${CMAKE_PROJECT_NAME} @@ -496,11 +509,6 @@ target_link_libraries(${CMAKE_PROJECT_NAME} QmlControls ) -if(QGC_BUILD_TESTING) - add_subdirectory(test) - target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE qgctest) -endif() - if(ANDROID) target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/android/src/AndroidInit.cc) @@ -519,15 +527,31 @@ if(ANDROID) endif() qt_import_plugins(${CMAKE_PROJECT_NAME} - INCLUDE Qt6::QSvgPlugin + INCLUDE Qt6::QSvgPlugin Qt6::QSvgIconPlugin EXCLUDE_BY_TYPE geoservices INCLUDE_BY_TYPE sqldrivers Qt6::QSQLiteDriverPlugin ) +set(BUILD_TESTING ${QGC_BUILD_TESTING} CACHE INTERNAL "" FORCE) +if(QGC_BUILD_TESTING) + add_compile_definitions(QGC_UNITTEST_BUILD) + include(CTest) + add_subdirectory(test) + target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE qgctest) +endif() + ####################################################### # Install Configuration ####################################################### +file(GLOB_RECURSE INSTALL_DIR_CONTENT ${CMAKE_INSTALL_PREFIX}/*) +list(LENGTH INSTALL_DIR_CONTENT CONTENT) +if(NOT CONTENT EQUAL 0) + message(WARNING "CMAKE_INSTALL_PREFIX (${CMAKE_INSTALL_PREFIX}) isn't empty." + "Please select another folder or clean it before running install command." + ) +endif() + include(InstallRequiredSystemLibraries) install( @@ -540,10 +564,14 @@ install( set(deploy_tool_options_arg "") if(MACOS) + list(APPEND deploy_tool_options_arg -appstore-compliant -qmldir=${CMAKE_SOURCE_DIR} -verbose=2) if(MACOS_SIGNING_IDENTITY) message(STATUS "Signing MacOS Bundle") - set(deploy_tool_options_arg -qmldir=${CMAKE_SOURCE_DIR} -verbose=2 -sign-for-notarization=${MACOS_SIGNING_IDENTITY}) # -dmg + list(APPEND deploy_tool_options_arg -sign-for-notarization="${MACOS_SIGNING_IDENTITY}") + else() + list(APPEND deploy_tool_options_arg -hardened-runtime -timestamp) endif() + # -dmg endif() qt_generate_deploy_qml_app_script( @@ -557,8 +585,8 @@ qt_generate_deploy_qml_app_script( install(SCRIPT ${deploy_script}) if(ANDROID) - # get_target_property(QGC_ANDROID_DEPLOY_FILE ${CMAKE_PROJECT_NAME} QT_ANDROID_DEPLOYMENT_SETTINGS_FILE) - # cmake_print_variables(QGC_ANDROID_DEPLOY_FILE) + get_target_property(QGC_ANDROID_DEPLOY_FILE ${CMAKE_PROJECT_NAME} QT_ANDROID_DEPLOYMENT_SETTINGS_FILE) + install(CODE "include(CMakePrintHelpers) cmake_print_variables(QT_DEPLOY_IGNORED_LIB_DIRS QT_DEPLOY_SUPPORT QGC_ANDROID_DEPLOY_FILE QT_ANDROID_APPLICATION_ARGUMENTS)") elseif(LINUX) configure_file( ${CMAKE_SOURCE_DIR}/deploy/linux/org.mavlink.qgroundcontrol.desktop.in diff --git a/CodingStyle.cc b/CodingStyle.cc index d50968fd0c7..3e9143f4fa8 100644 --- a/CodingStyle.cc +++ b/CodingStyle.cc @@ -1,6 +1,6 @@ /**************************************************************************** * - * (c) 2009-2016 QGROUNDCONTROL PROJECT + * (c) 2009-2024 QGROUNDCONTROL PROJECT * * QGroundControl is licensed according to the terms in the file * COPYING.md in the root of the source code directory. @@ -11,37 +11,37 @@ // coding style. In general almost everything in here has some coding style meaning. // Not all style choices are explained. +// Note how the Qt headers and the QGroundControl headers above are kept separate + #include "CodingStyle.h" -#include "QGCApplication.h" +#include "Fact.h" +#include "QGCLoggingCategory.h" -#include -#include +#include #include -// Note how the Qt headers and the QGroundControl headers above are kept separate +QGC_LOGGING_CATEGORY(CodingStyleLog, "CodingStyleLog") -Q_LOGGING_CATEGORY(CodingStyleLog, "CodingStyleLog") +CodingStyle::CodingStyle(QObject *parent) + : QObject(parent) +{ -const int CodingStyle::_privateStaticVariable = 0; +} -CodingStyle::CodingStyle(QObject* parent) : - QObject(parent), - _protectedVariable(1), - _privateVariable1(2), - _privateVariable2(3) +CodingStyle::~CodingStyle() { } /// Document non-obvious private methods in the code file. -void CodingStyle::_privateMethod(void) +void CodingStyle::_privateMethod() { // Always include braces even for single line if/for/... if (uas != _uasId) { return; } - + // Note the brace placement if (_lastSeenComponent == -1) { _lastSeenComponent = component; @@ -50,11 +50,11 @@ void CodingStyle::_privateMethod(void) } } -void CodingStyle::_privateMethod2(void) +void CodingStyle::_privateMethod2() { - Fact* fact = qobject_cast(sender()); + const Fact *const fact = qobject_cast(sender()); Q_ASSERT(fact); - + QVariant typedValue; switch (fact->type()) { case FactMetaData::valueTypeInt8: @@ -62,31 +62,30 @@ void CodingStyle::_privateMethod2(void) case FactMetaData::valueTypeInt32: typedValue.setValue(QVariant(value.toInt())); break; - case FactMetaData::valueTypeUint8: case FactMetaData::valueTypeUint16: case FactMetaData::valueTypeUint32: typedValue.setValue(value.toUInt()); break; - case FactMetaData::valueTypeFloat: { - int localScopedVar = 1; - typedValue.setValue(value.toFloat()); + const int localScopedVar = 1; + typedValue.setValue(value.toFloat() + localScopedVar); } break; - case FactMetaData::valueTypeDouble: typedValue.setValue(value.toDouble()); break; + default: + break; } } -void CodingStyle::_methodWithManyArguments(QWidget* parent, - const QString& caption, - const QString& dir, - Options options1, - Options /* options2 */, - Options options3) +void CodingStyle::_methodWithManyArguments(QWidget *parent, + const QString &caption, + const QString &dir, + Options options1, + Options /* options2 */, + Options options3) { // options2 is an unused method argument. // Do not use Q_UNUSUED and do not just remove the argument name and leave the type. diff --git a/CodingStyle.h b/CodingStyle.h index 22300e5e265..3e0ccabfeba 100644 --- a/CodingStyle.h +++ b/CodingStyle.h @@ -1,6 +1,6 @@ /**************************************************************************** * - * (c) 2009-2016 QGROUNDCONTROL PROJECT + * (c) 2009-2024 QGROUNDCONTROL PROJECT * * QGroundControl is licensed according to the terms in the file * COPYING.md in the root of the source code directory. @@ -13,67 +13,63 @@ #pragma once -#include -#include -#include -#include +/// Note how the Qt headers, System, headers and the QGroundControl headers above are kept in separate groups +#include +#include +#include +#include #include -#include "Fact.h" - -// Note how the Qt headers, System, headers and the QGroundControl headers above are kept in separate groups - -// If you are going to use a logging category for a class it should have the same name as the class -// with a suffix of Log. +/// If you are going to use a logging category for a class it should have the same name as the class +/// with a suffix of Log. Q_DECLARE_LOGGING_CATEGORY(CodingStyleLog) /// Here is the class documentation. Class names are PascalCase. If you override any of the Qt base classes to provide /// generic base implementations for widespread use prefix the class name with QGC. For example: /// QGCMessageBox - is a QGC special vesion of Qt MessageBox /// QGCPalette - is a QGC special version of Qt Palette -/// For normal single use classes do no prefix them name with QGC. +/// For normal single use classes do not prefix them name with QGC. class CodingStyle : public QObject { Q_OBJECT - + public: - CodingStyle(QObject* parent = NULL); + explicit CodingStyle(QObject *parent = nullptr); ~CodingStyle(); - + /// Document public methods which are non-obvious in the header file - bool publicMethod1(void); - + bool publicMethod1(); + signals: /// Document signals which are non-obvious in the header file - void qtSignal(void); - + void qtSignal(); + public slots: - // Public slots should only be used if the slot is connected to from another class. Majority of slots - // should be private. - void publicSlot(void); - - // Don't use protected methods or variables unless the class is specifically meant to be used as a base class. + /// Public slots should only be used if the slot is connected to from another class. Majority of slots + /// should be private. + void publicSlot(); + protected: - int _protectedVariable; ///< variable names are camelCase - - void _protectedMethod(void); ///< method names are camelCase - + /// Don't use protected methods or variables unless the class is specifically meant to be used as a base class. + void _protectedMethod(); ///< method names are camelCase + + int _protectedVariable = 1; ///< variable names are camelCase + private slots: - void _privateSlot(void); - + void _privateSlot(); + private: - // Private methods and variable names begin with an "_". Documentation for - // non-obvious private methods goes in the code file, not the header. - void _privateMethod(void); - - void _methodWithManyArguments(QWidget* parent, const QString& caption, const QString& dir, Options options1, Options options2, Options options3); + /// Private methods and variable names begin with an "_". Documentation for + /// non-obvious private methods goes in the code file, not the header. + void _privateMethod(); + + void _methodWithManyArguments(QWidget *parent, const QString &caption, const QString &dir, Options options1, Options options2, Options options3); /// Document non-obvious variables in the header file. Long descriptions go here. - int _privateVariable1; - - int _privateVariable2; ///< Short descriptions go here - - static const int _privateStaticVariable; + int _privateVariable1 = 2; + int _privateVariable2 = 3; ///< Short descriptions go here + + static constexpr int _privateStaticVariable = 0; }; diff --git a/CodingStyle.qml b/CodingStyle.qml index 79c70d49912..737b8a58c47 100644 --- a/CodingStyle.qml +++ b/CodingStyle.qml @@ -1,20 +1,19 @@ /**************************************************************************** * - * (c) 2009-2016 QGROUNDCONTROL PROJECT + * (c) 2009-2024 QGROUNDCONTROL PROJECT * * QGroundControl is licensed according to the terms in the file * COPYING.md in the root of the source code directory. * ****************************************************************************/ - import QtQuick import QtQuick.Controls import QGroundControl -import QGroundControl.ScreenTools import QGroundControl.Controls import QGroundControl.Palette +import QGroundControl.ScreenTools /// This is an example Qml file which is used to describe the QGroundControl coding style. /// In general almost everything in here has some coding style meaning including order of @@ -22,16 +21,16 @@ import QGroundControl.Palette /// and we'll answer and update style as needed. Item { // Property binding to item properties - width: ScreenTools.defaultFontPixelHeight * 10 // No hardcoded sizing. All sizing must be relative to a ScreenTools font size + width: ScreenTools.defaultFontPixelHeight * 10 // No hardcoded sizing. All sizing must be relative to a ScreenTools font size height: ScreenTools.defaultFontPixelHeight * 20 // Property definitions available to consumers of this Qml Item come first - property int myIntProperty: 10 - property real myRealProperty: 20.0 + property int myIntProperty: 10 + property real myRealProperty: 20.0 // Property definitions which are internal to the item are prepending with an underscore // to signal private and come second - readonly property real _rectWidth: ScreenTools.defaultFontPixelWidth * 10 // Use readonly appropriately to increase binding performance + readonly property real _rectWidth: ScreenTools.defaultFontPixelWidth * 10 // Use readonly appropriately to increase binding performance readonly property real _rectHeight: ScreenTools.defaultFontPixelWidth * 10 function myFunction() { @@ -39,8 +38,8 @@ Item { } QGCPalette { - id: qgcPal // Note how id does not use an underscore - colorGroupEnabled: enabled + id: qgcPal // Note how id does not use an underscore + colorGroupEnabled: enabled } // You should always use the QGC provided variants of base control since they automatically support @@ -53,9 +52,9 @@ Item { } Rectangle { - width: _rectWidth + width: _rectWidth height: _rectHeight - color: qgcPal.window // Use QGC palette colors for everything, no hardcoded colors + color: qgcPal.window // Use QGC palette colors for everything, no hardcoded colors } // For scoped blocks which are long include a comment so you can tell what the brace is matching. diff --git a/CMakePresets.json b/_CMakePresets.json similarity index 100% rename from CMakePresets.json rename to _CMakePresets.json diff --git a/android/build.gradle b/android/build.gradle index 679b034ed7f..5ca978c17bc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -93,7 +93,12 @@ android { targetSdkVersion qtTargetSdkVersion ndk.abiFilters = qtTargetAbiList.split(",") - // println "applicationId: ${applicationId}" + namespace1 = androidPackageName + namespace2 = "org.mavlink.qgroundcontrol" + + println "applicationId: ${applicationId}" + println "namespace1: ${namespace2}" + println "namespace1: ${namespace2}" println "minSdkVersion: ${minSdkVersion}" println "targetSdkVersion: ${targetSdkVersion}" println "ndk.abiFilters: ${ndk.abiFilters}" diff --git a/cmake/CustomOptions.cmake b/cmake/CustomOptions.cmake index 7841a11c789..7f151c7ffb6 100644 --- a/cmake/CustomOptions.cmake +++ b/cmake/CustomOptions.cmake @@ -1,47 +1,74 @@ # The following options can be overriden by custom builds using the CustomOverrides.cmake file -# General +# CMake +option(BUILD_SHARED_LIBS "Build using shared libraries" OFF) + +# Qt +set(QT_MINIMUM_VERSION "6.8.1" CACHE STRING "Minimum Supported Qt Version") +set(QT_MAXIMUM_VERSION "6.8.1" CACHE STRING "Maximum Supported Qt Version") +set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml" CACHE PATH "Install path for QML") +set(QML_IMPORT_PATH "${QT_QML_OUTPUT_DIRECTORY}" CACHE STRING "Extra QML Import Paths") +option(QML_IMPORT_TRACE "Debug QML Imports" OFF) +option(QT_SILENCE_MISSING_DEPENDENCY_TARGET_WARNING "Silence Missing Dependency Warnings" OFF) +option(QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS "Generate Java QuickView Contents" OFF) +option(QT_ENABLE_VERBOSE_DEPLOYMENT "Verbose Deployment" OFF) + +# Android +set(QGC_QT_ANDROID_MIN_SDK_VERSION "28" CACHE STRING "Android Min SDK Version") +set(QGC_QT_ANDROID_TARGET_SDK_VERSION "35" CACHE STRING "Android Target SDK Version") +set(QGC_ANDROID_PACKAGE_NAME "org.mavlink.qgroundcontrol" CACHE STRING "Android Package Name") +set(QGC_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/android" CACHE PATH "Android Package Path") +set(QT_ANDROID_DEPLOYMENT_TYPE "" CACHE STRING "Forces Signing if Set to Release") +option(QT_ANDROID_SIGN_APK "Enable Signing APK" OFF) +option(QT_ANDROID_SIGN_AAB "Enable Signing AAB" OFF) +option(QT_USE_TARGET_ANDROID_BUILD_DIR "Use Target Android Build Dir" OFF) + +# MacOS +set(QGC_BUNDLE_ID "org.qgroundcontrol.QGroundControl" CACHE STRING "MacOS Bundle ID") # MACOS +set(QGC_MACOS_ICON_PATH "${CMAKE_SOURCE_DIR}/deploy/macos" CACHE PATH "MacOS Icon Path") # MACOS + +# Linux +set(QGC_APPIMAGE_ICON_PATH "${CMAKE_SOURCE_DIR}/resources/icons/qgroundcontrol.png" CACHE FILEPATH "AppImage Icon Path") + +# Windows +set(QGC_WINDOWS_INSTALL_HEADER_PATH "${CMAKE_SOURCE_DIR}/deploy/windows/installheader.bmp" CACHE FILEPATH "Windows Install Header Path") +set(QGC_WINDOWS_ICON_PATH "${CMAKE_SOURCE_DIR}/deploy/windows/WindowsQGC.ico" CACHE FILEPATH "Windows Icon Path") + +# App set(QGC_APP_NAME "QGroundControl" CACHE STRING "App Name") -set(QGC_APP_COPYRIGHT "Copyright (c) 2024 QGroundControl. All rights reserved." CACHE STRING "Copyright") +set(QGC_APP_COPYRIGHT "Copyright (c) 2025 QGroundControl. All rights reserved." CACHE STRING "Copyright") set(QGC_APP_DESCRIPTION "Open Source Ground Control App" CACHE STRING "Description") set(QGC_ORG_NAME "QGroundControl.org" CACHE STRING "Org Name") set(QGC_ORG_DOMAIN "org.qgroundcontrol" CACHE STRING "Domain") +set(QGC_APP_VERSION "v1.0" CACHE STRING "App Version") +set(QGC_APP_DATE "2025-1-1" CACHE STRING "App Build Date") +set(QGC_SETTINGS_VERSION "9" CACHE STRING "Settings Version - Increment to clear settings (Required after incompatible settings change)") +# Build option(QGC_STABLE_BUILD "Stable Build" OFF) -option(QGC_DOWNLOAD_DEPENDENCIES "Download Dependencies if Possible" ON) +option(QGC_DOWNLOAD_DEPENDENCIES "Download Dependency Binaries if Possible" OFF) +option(QGC_BUILD_DEPENDENCIES "Force Building of Dependencies" OFF) +# Comms option(QGC_ENABLE_BLUETOOTH "Enable Bluetooth Links" ON) # Qt6Bluetooth_FOUND option(QGC_ZEROCONF_ENABLED "Enable ZeroConf Compatibility" OFF) -option(QGC_AIRLINK_DISABLED "Disable AIRLink" ON) +option(QGC_AIRLINK_DISABLED "Disable AIRLink" OFF) option(QGC_NO_SERIAL_LINK "Disable Serial Links" OFF) # NOT IOS AND Qt6SerialPort_FOUND +# Features +option(QGC_DISABLE_MAVLINK_INSPECTOR "Disable MAVLink Inspector" OFF) # This removes QtCharts which is GPL licensed option(QGC_UTM_ADAPTER "Enable UTM Adapter" OFF) option(QGC_VIEWER3D "Enable Viewer3D" ON) # Qt6Quick3D_FOUND +# Video option(QGC_ENABLE_UVC "Enable UVC Devices" ON) # Qt6Multimedia_FOUND option(QGC_ENABLE_GST_VIDEOSTREAMING "Enable GStreamer Video Backend" ON) option(QGC_ENABLE_QT_VIDEOSTREAMING "Enable QtMultimedia Video Backend" OFF) # Qt6Multimedia_FOUND +# MAVLink set(QGC_MAVLINK_GIT_REPO "https://github.com/mavlink/c_library_v2.git" CACHE STRING "URL to MAVLink Git Repo") set(QGC_MAVLINK_GIT_TAG "b71f061a53941637cbcfc5bcf860f96bc82e0892" CACHE STRING "Tag of MAVLink Git Repo") -# Android -set(QGC_QT_ANDROID_MIN_SDK_VERSION "28" CACHE STRING "Android Min SDK Version") -set(QGC_QT_ANDROID_TARGET_SDK_VERSION "35" CACHE STRING "Android Target SDK Version") -set(QGC_ANDROID_PACKAGE_NAME "org.mavlink.qgroundcontrol" CACHE STRING "Android Package Name") -set(QGC_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/android" CACHE PATH "Android Package Path") - -# MacOS -set(QGC_BUNDLE_ID "org.qgroundcontrol.QGroundControl" CACHE STRING "MacOS Bundle ID") # MACOS -set(QGC_MACOS_ICON_PATH "${CMAKE_SOURCE_DIR}/deploy/macos" CACHE PATH "MacOS Icon Path") # MACOS - -# Linux -set(QGC_APPIMAGE_ICON_PATH "${CMAKE_SOURCE_DIR}/resources/icons/qgroundcontrol.png" CACHE FILEPATH "AppImage Icon Path") - -# Windows -set(QGC_WINDOWS_INSTALL_HEADER_PATH "${CMAKE_SOURCE_DIR}/deploy/windows/installheader.bmp" CACHE FILEPATH "Windows Install Header Path") -set(QGC_WINDOWS_ICON_PATH "${CMAKE_SOURCE_DIR}/deploy/windows/WindowsQGC.ico" CACHE FILEPATH "Windows Icon Path") - # APM option(QGC_DISABLE_APM_MAVLINK "Disable APM Dialect" OFF) option(QGC_DISABLE_APM_PLUGIN "Disable APM Plugin" OFF) @@ -50,7 +77,3 @@ option(QGC_DISABLE_APM_PLUGIN_FACTORY "Disable APM Plugin Factory" OFF) # PX4 option(QGC_DISABLE_PX4_PLUGIN "Disable PX4 Plugin" OFF) option(QGC_DISABLE_PX4_PLUGIN_FACTORY "Disable PX4 Plugin Factory" OFF) - -# If you need to make an incompatible changes to stored settings, bump this version number -# up by 1. This will caused store settings to be cleared on next boot. -set(QGC_SETTINGS_VERSION "9" CACHE STRING "Settings Version") diff --git a/cmake/Git.cmake b/cmake/Git.cmake index a4a716ab91c..03e009c99f8 100644 --- a/cmake/Git.cmake +++ b/cmake/Git.cmake @@ -1,24 +1,5 @@ find_package(Git) -if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git") - option(GIT_SUBMODULE "Check submodules during build" OFF) - if(GIT_SUBMODULE) - message(STATUS "Submodule update") - execute_process( - COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - RESULT_VARIABLE GIT_SUBMODULE_RESULT - OUTPUT_VARIABLE GIT_SUBMODULE_OUTPUT - ERROR_VARIABLE GIT_SUBMODULE_ERROR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(NOT GIT_SUBMODULE_RESULT EQUAL 0) - cmake_print_variables(GIT_SUBMODULE_RESULT GIT_SUBMODULE_OUTPUT GIT_SUBMODULE_ERROR) - message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMODULE_RESULT}, please checkout submodules") - endif() - endif() -endif() - include(CMakePrintHelpers) execute_process( @@ -40,10 +21,10 @@ cmake_print_variables(QGC_GIT_HASH) execute_process( COMMAND ${GIT_EXECUTABLE} describe --always --tags WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE QGC_APP_VERSION_STR + OUTPUT_VARIABLE QGC_APP_TAG OUTPUT_STRIP_TRAILING_WHITESPACE ) -cmake_print_variables(QGC_APP_VERSION_STR) +cmake_print_variables(QGC_APP_TAG) execute_process( COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=0 diff --git a/cmake/Qt6QGCConfiguration.cmake b/cmake/Qt6QGCConfiguration.cmake deleted file mode 100644 index 6c9332dafa8..00000000000 --- a/cmake/Qt6QGCConfiguration.cmake +++ /dev/null @@ -1,61 +0,0 @@ -if(DEFINED ENV{QT_VERSION}) - set(QT_VERSION $ENV{QT_VERSION}) -endif() - -if(NOT QT_VERSION) - # if QT version not specified then use any available version - file(GLOB FOUND_QT_VERSIONS - LIST_DIRECTORIES true - $ENV{HOME}/Qt/6.8.* - ) - if(NOT FOUND_QT_VERSIONS) - return() - endif() - list(GET FOUND_QT_VERSIONS 0 QT_VERSION_PATH) - get_filename_component(QT_VERSION ${QT_VERSION_PATH} NAME) -endif() - -if(DEFINED ENV{QT_MKSPEC}) - set(QT_MKSPEC $ENV{QT_MKSPEC}) -endif() - -if(NOT QT_MKSPEC) - if(APPLE) - set(QT_MKSPEC clang_64) - elseif(LINUX) - set(QT_MKSPEC gcc_64) - elseif(WIN32) - set(QT_MKSPEC msvc2022_64) - elseif(ANDROID) - if(${ANDROID_ABI} STREQUAL armeabi-v7a) - set(QT_MKSPEC android_armv7) - elseif(${ANDROID_ABI} STREQUAL arm64-v8a) - set(QT_MKSPEC android_arm64_v8a) - elseif(${ANDROID_ABI} STREQUAL x86) - set(QT_MKSPEC android_x86) - elseif(${ANDROID_ABI} STREQUAL x86_64) - set(QT_MKSPEC android_x86_64) - endif() - endif() -endif() - -set(QT_LIBRARY_HINTS - $ENV{QT_PATH}/${QT_VERSION}/${QT_MKSPEC} - ${Qt6_DIR} -) - -if(ANDROID) - list(APPEND QT_LIBRARY_HINTS ${QT_HOST_PATH}/lib/cmake) -elseif(WIN32) - list(APPEND QT_LIBRARY_HINTS C:/Qt/${QT_VERSION}/${QT_MKSPEC}) -elseif(LINUX) - list(APPEND QT_LIBRARY_HINTS $ENV{HOME}/Qt/${QT_VERSION}/${QT_MKSPEC}) -endif() - -include(CMakePrintHelpers) -cmake_print_variables(QT_VERSION QT_MKSPEC QT_LIBRARY_HINTS) - -# if(ANDROID) - # set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT}) - # message(STATUS "PKG_CONFIG_SYSROOT_DIR $ENV{PKG_CONFIG_SYSROOT_DIR}") -# endif() diff --git a/cmake/printSummary.cmake b/cmake/printSummary.cmake index 3dda683517a..960d676a934 100644 --- a/cmake/printSummary.cmake +++ b/cmake/printSummary.cmake @@ -20,17 +20,26 @@ message( STATUS "--------------------------------------------------------------- message( STATUS "" ) message( STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}" ) message( STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}" ) -message( STATUS "CMAKE_GENERATOR_INSTANCE: ${CMAKE_GENERATOR_INSTANCE}" ) -message( STATUS "CMAKE_GENERATOR_PLATFORM: ${CMAKE_GENERATOR_PLATFORM}" ) -message( STATUS "CMAKE_GENERATOR_TOOLSET: ${CMAKE_GENERATOR_TOOLSET}" ) message( STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}" ) message( STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) ; version: ${CMAKE_CXX_COMPILER_VERSION}" ) message( STATUS "CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}" ) message( STATUS "CMAKE_CXX_COMPILER_LAUNCHER: ${CMAKE_CXX_COMPILER_LAUNCHER}" ) +message( STATUS "CMAKE_CXX_COMPILER_LAUNCHER: ${CMAKE_CXX_COMPILER_LAUNCHER}" ) +# CMAKE_CXX_EXTENSIONS message( STATUS "CMAKE_C_COMPILER_LAUNCHER: ${CMAKE_C_COMPILER_LAUNCHER}" ) if(APPLE) message( STATUS "CMAKE_OBJC_COMPILER_LAUNCHER:${CMAKE_OBJC_COMPILER_LAUNCHER}" ) +# CMAKE_OSX_SYSROOT +# CMAKE_OSX_ARCHITECTURES +# CMAKE_OSX_DEPLOYMENT_TARGET endif() +# if(MSVC) +# CMAKE_MSVC_DEBUG_INFORMATION_FORMAT +# endif() +# if(WIN32) +# CMAKE_WIN32_EXECUTABLE +# endif() +# CMAKE_PROJECT_NAME message( STATUS "CMAKE_VERSION: ${CMAKE_VERSION}" ) message( STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}" ) message( STATUS "CMAKE_HOST_SYSTEM_NAME: ${CMAKE_HOST_SYSTEM_NAME}" ) @@ -38,7 +47,20 @@ message( STATUS "CMAKE_HOST_SYSTEM_VERSION: ${CMAKE_HOST_SYSTEM_VERSION}" ) message( STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}" ) message( STATUS "CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}" ) message( STATUS "CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}" ) +message( STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}" ) message( STATUS "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}" ) +message( STATUS "CMAKE_CROSSCOMPILING ${CMAKE_CROSSCOMPILING}" ) +CMAKE_AUTOMOC +CMAKE_AUTOUIC +CMAKE_AUTORCC +# CMAKE_POSITION_INDEPENDENT_CODE +# CMAKE_INTERPROCEDURAL_OPTIMIZATION +# CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG +# CMAKE_EXPORT_COMPILE_COMMANDS +# if(CMAKE_CROSSCOMPILING) +# CMAKE_HOST_SYSTEM_PROCESSOR +# CMAKE_SYSTEM_PROCESSOR +# endif() message( STATUS "" ) message( STATUS " --- Compiler flags --- ") message( STATUS "General: ${CMAKE_CXX_FLAGS}" ) @@ -62,18 +84,21 @@ message( STATUS "App Copyright: ${QGC_APP_COPYRIGHT}" ) message( STATUS "App Description: ${QGC_APP_DESCRIPTION}" ) message( STATUS "Org Name: ${QGC_ORG_NAME}" ) message( STATUS "App Domain: ${QGC_ORG_DOMAIN}" ) -message( STATUS "App Version: ${QGC_APP_VERSION_STR}" ) +message( STATUS "App Version: ${QGC_APP_VERSION}" ) +# QGC_APP_TAG +# QGC_SETTINGS_VERSION if(MACOS) message( STATUS "MacOS Bundle ID: ${QGC_BUNDLE_ID}" ) message( STATUS "MacOS Icon Path: ${QGC_MACOS_ICON_PATH}" ) +# QGC_MACOS_UNIVERSAL_BUILD endif() -if(ANDROID) -message( STATUS "Android NDK Host System ${ANDROID_NDK_HOST_SYSTEM_NAME}" ) -message( STATUS "Android SDK Root ${ANDROID_SDK_ROOT}" ) +if(WIN32) +QGC_INSTALLER_SOURCE_WIN endif() + +# QGC_CUSTOM_BUILD OptionOutput( "Stable Build: " QGC_STABLE_BUILD ) OptionOutput( "Building Tests: " QGC_BUILD_TESTING AND BUILD_TESTING ) -OptionOutput( "Debug QML: " QGC_DEBUG_QML ) OptionOutput( "Build Dependencies: " QGC_BUILD_DEPENDENCIES ) OptionOutput( "Disable APM Dialect: " QGC_DISABLE_APM_MAVLINK ) OptionOutput( "Disable APM Plugin: " QGC_DISABLE_APM_PLUGIN ) @@ -91,6 +116,75 @@ OptionOutput( "Enable GStreamer: " QGC_ENABLE_GST_VIDEOSTREAMING ) OptionOutput( "Enable QtMultimedia: " QGC_ENABLE_QT_VIDEOSTREAMING ) message( STATUS "MAVLink Git Repo: ${QGC_MAVLINK_GIT_REPO}" ) message( STATUS "MAVLink Git Tag: ${QGC_MAVLINK_GIT_TAG}" ) +# QGC_RESOURCES message( STATUS "" ) message( STATUS "------------------------------------------------------------------" ) message( STATUS "" ) + +OptionOutput( "Debug QML: " QT_QML_DEBUG ) +# NDEBUG +# QT_NO_DEBUG +# QT_NO_DEBUG_OUTPUT +# QT_FATAL_WARNINGS +# QT_NO_DEBUG_OUTPUT +# QT_NO_INFO_OUTPUT +# QT_NO_WARNING_OUTPUT + +# QT_QML_OUTPUT_DIRECTORY + +# QT_I18N_SOURCE_LANGUAGE +# QT_I18N_TRANSLATED_LANGUAGES + +# if(IOS) +# QT_IOS_LAUNCH_SCREEN +# endif() + +if(ANDROID) +message( STATUS "Android NDK Host System ${ANDROID_NDK_HOST_SYSTEM_NAME}" ) +message( STATUS "Android SDK Root ${ANDROID_SDK_ROOT}" ) +# message(STATUS "QT_ANDROID_KEYSTORE_PATH $ENV{QT_ANDROID_KEYSTORE_PATH}") +# message(STATUS "QT_ANDROID_KEYSTORE_ALIAS $ENV{QT_ANDROID_KEYSTORE_ALIAS}") +# message(STATUS "QT_ANDROID_KEYSTORE_STORE_PASS $ENV{QT_ANDROID_KEYSTORE_STORE_PASS}") +# message(STATUS "QT_ANDROID_KEYSTORE_KEY_PASS $ENV{QT_ANDROID_KEYSTORE_KEY_PASS}") +# QT_ANDROID_MULTI_ABI_FORWARD_VARS +# QT_ANDROID_DEPLOYMENT_TYPE +# QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS +# QT_ANDROID_DEPLOYMENT_TYPE +# QT_ANDROID_SIGN_APK +# QT_ANDROID_SIGN_AAB +# QT_USE_TARGET_ANDROID_BUILD_DIR +# QT_ANDROID_ABIS +# QT_ANDROID_BUILD_ALL_ABIS # Overrides QT_ANDROID_ABIS +# QT_PATH_ANDROID_ABI_armeabi-v7a +# QT_PATH_ANDROID_ABI_arm64-v8a +# QT_PATH_ANDROID_ABI_x86 +# QT_PATH_ANDROID_ABI_x86_64 +endif() + +# QT_MINIMUM_VERSION +# QT_MAXIMUM_VERSION +# QT_DEPLOY_BIN_DIR +# QT_DEPLOY_IGNORED_LIB_DIRS +# QT_DEPLOY_LIBEXEC_DIR +# QT_DEPLOY_LIB_DIR +# QT_DEPLOY_PLUGINS_DIR +# QT_DEPLOY_PREFIX +# QT_DEPLOY_QML_DIR +# QT_DEPLOY_SUPPORT +# QT_DEPLOY_TRANSLATIONS_DIR +# QT_ENABLE_VERBOSE_DEPLOYMENT + +# QT_HOST_PATH + +# deploy_script +# deploy_tool_options_arg + +# Environment Variables +# SET(ENV{QT_MESSAGE_PATTERN} "[%{time process} %{type}] %{appname} %{category} %{function} - %{message}") +# set(ENV{QT_DEBUG_PLUGINS} ON) +# set(ENV{QML_IMPORT_TRACE} ON) +# SET(ENV{QT_HASH_SEED} 1234) +# SET(ENV{QT_WIN_DEBUG_CONSOLE} new) + +# Project Target Properties +# get_target_property(QGC_ANDROID_DEPLOY_FILE ${CMAKE_PROJECT_NAME} QT_ANDROID_DEPLOYMENT_SETTINGS_FILE) diff --git a/codecov.yml b/codecov.yml index d25776f5338..28eb813be3b 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,7 +1,10 @@ +codecov: + notify: + require_ci_to_pass: yes + coverage: - round: down - precision: 1 status: project: default: - threshold: 1% + target: 10% + threshold: 5% diff --git a/custom-example/CMakeLists.txt b/custom-example/CMakeLists.txt index 7f2e467ad67..10045e5a462 100644 --- a/custom-example/CMakeLists.txt +++ b/custom-example/CMakeLists.txt @@ -1,4 +1,5 @@ message(STATUS "Adding Custom Plugin") + find_package(Qt6 REQUIRED COMPONENTS Core) # Enable custom build @@ -54,9 +55,9 @@ list(APPEND CUSTOM_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/qgroundcontrol.qrc ${CMAKE_CURRENT_SOURCE_DIR}/custom.qrc ) -set(QGC_RESOURCES ${CUSTOM_RESOURCES} PARENT_SCOPE) +set(QGC_RESOURCES ${QGC_RESOURCES} ${CUSTOM_RESOURCES} CACHE STRING "Target Deployable Resources" FORCE) -set(QML_IMPORT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/res" CACHE STRING "Extra qml import paths" PARENT_SCOPE) +set(QML_IMPORT_PATH ${QML_IMPORT_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/qml ${CMAKE_CURRENT_SOURCE_DIR}/res CACHE STRING "Extra qml import paths" FORCE) qt_add_library(CustomPlugin STATIC src/CustomPlugin.cc diff --git a/deploy/android/GooglePlayDailyIcon.png b/deploy/android/GooglePlayDailyIcon.png deleted file mode 100644 index 087667afdbb..00000000000 Binary files a/deploy/android/GooglePlayDailyIcon.png and /dev/null differ diff --git a/deploy/android/GooglePlayFeatureGraphic.png b/deploy/android/GooglePlayFeatureGraphic.png deleted file mode 100644 index e49b9949cc3..00000000000 Binary files a/deploy/android/GooglePlayFeatureGraphic.png and /dev/null differ diff --git a/deploy/android/GooglePlayScreenShot1.jpg b/deploy/android/GooglePlayScreenShot1.jpg deleted file mode 100755 index 4adfd44fbdd..00000000000 Binary files a/deploy/android/GooglePlayScreenShot1.jpg and /dev/null differ diff --git a/deploy/android/GooglePlayScreenShot2.jpg b/deploy/android/GooglePlayScreenShot2.jpg deleted file mode 100755 index 04f2ad672e8..00000000000 Binary files a/deploy/android/GooglePlayScreenShot2.jpg and /dev/null differ diff --git a/deploy/android/GooglePlayUpload.py b/deploy/android/GooglePlayUpload.py deleted file mode 100755 index dc61591b823..00000000000 --- a/deploy/android/GooglePlayUpload.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2014 Marta Rodriguez. -# -# Licensed under the Apache License, Version 2.0 (the 'License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Uploads an apk to the google play store.""" - -import argparse - -from apiclient.discovery import build -import httplib2 -from oauth2client import client -from oauth2client.service_account import ServiceAccountCredentials - -JSON_KEY='Google_Play_Android_Developer-4432a3c4f5d1.json' - -# Declare command-line flags. -argparser = argparse.ArgumentParser(add_help=False) -argparser.add_argument('package_name', - help='The package name. Example: com.android.sample') - -def main(): - # Create an httplib2.Http object to handle our HTTP requests and authorize it - # with the Credentials. Note that the first parameter, service_account_name, - # is the Email address created for the Service account. It must be the email - # address associated with the key that was created. - credentials = ServiceAccountCredentials.from_json_keyfile_name(JSON_KEY, scopes=['https://www.googleapis.com/auth/androidpublisher']) - - http = httplib2.Http() - http = credentials.authorize(http) - - service = build('androidpublisher', 'v3', http=http) - - # Process flags and read their values. - flags = argparser.parse_args() - - release_track = 'production' - package_name = flags.package_name - - try: - print 'Uploading package %s to track %s' % (package_name, release_track) - edit_request = service.edits().insert(body={}, packageName=package_name) - result = edit_request.execute() - edit_id = result['id'] - - apk_response_32 = service.edits().apks().upload( - editId=edit_id, - packageName=package_name, - media_body='QGroundControl32.apk').execute() - print 'Version code %d has been uploaded' % apk_response_32['versionCode'] - - apk_response_64 = service.edits().apks().upload( - editId=edit_id, - packageName=package_name, - media_body='QGroundControl64.apk').execute() - print 'Version code %d has been uploaded' % apk_response_64['versionCode'] - - track_response = service.edits().tracks().update( - editId=edit_id, - track=release_track, - packageName=package_name, - body={u'releases': [{ - u'versionCodes': [str(apk_response_32['versionCode']), str(apk_response_64['versionCode'])], - u'status': u'completed', - }]}).execute() - - print 'Track %s is set with releases: %s' % ( - track_response['track'], str(track_response['releases'])) - - commit_request = service.edits().commit( - editId=edit_id, packageName=package_name).execute() - - print 'Edit "%s" has been committed' % (commit_request['id']) - - except client.AccessTokenRefreshError: - print ('The credentials have been revoked or expired, please re-run the ' - 'application to re-authorize') - -if __name__ == '__main__': - main() diff --git a/deploy/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc b/deploy/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc deleted file mode 100644 index dae400d87ac..00000000000 Binary files a/deploy/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc and /dev/null differ diff --git a/deploy/ios/qgroundcontrol.xcconfig b/deploy/ios/qgroundcontrol.xcconfig deleted file mode 100644 index 646c6ddd0b1..00000000000 --- a/deploy/ios/qgroundcontrol.xcconfig +++ /dev/null @@ -1,17 +0,0 @@ -CODE_SIGN_IDENTITY = ""; -CODE_SIGNING_REQUIRED = NO; -CLANG_WARN_BOOL_CONVERSION = YES; -CLANG_WARN_CONSTANT_CONVERSION = YES; -CLANG_WARN_EMPTY_BODY = YES; -CLANG_WARN_ENUM_CONVERSION = YES; -CLANG_WARN_INT_CONVERSION = YES; -CLANG_WARN_UNREACHABLE_CODE = YES; -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; -ENABLE_STRICT_OBJC_MSGSEND = YES; -GCC_NO_COMMON_BLOCKS = YES; -GCC_WARN_64_TO_32_BIT_CONVERSION = YES; -GCC_WARN_ABOUT_RETURN_TYPE = YES; -GCC_WARN_UNDECLARED_SELECTOR = YES; -GCC_WARN_UNINITIALIZED_AUTOS = YES; -GCC_WARN_UNUSED_FUNCTION = YES; -GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/deploy/ios/qgroundcontrol_appstore.xcconfig b/deploy/ios/qgroundcontrol_appstore.xcconfig deleted file mode 100644 index f4b31d807f4..00000000000 --- a/deploy/ios/qgroundcontrol_appstore.xcconfig +++ /dev/null @@ -1,17 +0,0 @@ -CODE_SIGN_IDENTITY = "iPhone Distribution"; -#PROVISIONING_PROFILE = f22bae36-10c2-4fd8-b6f1-c83e47765614; -CLANG_WARN_BOOL_CONVERSION = YES; -CLANG_WARN_CONSTANT_CONVERSION = YES; -CLANG_WARN_EMPTY_BODY = YES; -CLANG_WARN_ENUM_CONVERSION = YES; -CLANG_WARN_INT_CONVERSION = YES; -CLANG_WARN_UNREACHABLE_CODE = YES; -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; -ENABLE_STRICT_OBJC_MSGSEND = YES; -GCC_NO_COMMON_BLOCKS = YES; -GCC_WARN_64_TO_32_BIT_CONVERSION = YES; -GCC_WARN_ABOUT_RETURN_TYPE = YES; -GCC_WARN_UNDECLARED_SELECTOR = YES; -GCC_WARN_UNINITIALIZED_AUTOS = YES; -GCC_WARN_UNUSED_FUNCTION = YES; -GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/deploy/linux/appimagecraft.yml b/deploy/linux/appimagecraft.yml new file mode 100644 index 00000000000..7863231dfaf --- /dev/null +++ b/deploy/linux/appimagecraft.yml @@ -0,0 +1,23 @@ +version: 1 + +project: + name: QGroundControl + version: Daily + +build: + cmake: + source_dir: src/ + extra_variables: + - Qt6_ROOT=/home/runner/work/_temp/Qt/6.6.3/gcc_64 + environment: + BUILD_TYPE: Release + +appimage: + linuxdeploy: + plugins: + # - qt + raw_environment: + QML_SOURCES_PATHS: "\"$PROJECT_ROOT\"/src/qmlcomponents/" + environment: + EXTRA_PLATFORM_PLUGINS: "libqwayland-egl.so;libqwayland-generic.so" + EXTRA_QT_PLUGINS: "waylandcompositor" diff --git a/deploy/linux/org.mavlink.qgroundcontrol.flatpak.yml b/deploy/linux/org.mavlink.qgroundcontrol.flatpak.yml new file mode 100644 index 00000000000..36ad9105c85 --- /dev/null +++ b/deploy/linux/org.mavlink.qgroundcontrol.flatpak.yml @@ -0,0 +1,40 @@ +app-id: org.mavlink.qgroundcontrol +runtime: org.kde.Platform +runtime-version: 6.8 +sdk: org.kde.Sdk +command: QGroundControl +rename-appdata-file: org.mavlink.qgroundcontrol.metainfo.xml + +finish-args: + - --socket=wayland + - --socket=fallback-x11 + - --socket=pulseaudio + - --device=all # allow access USB Serial + - --share=ipc + - --share=network + - --filesystem=home + - --filesystem=xdg-run/gvfs # GVfs + - --filesystem=/media # automount via udisks + - --filesystem=/run/udev:ro # enables firmware upload & auto connecting + +modules: + - name: QGroundControl + sources: + - type: git + url: https://github.com/mavlink/qgroundcontrol.git + tag: master + commit: e9e8f4cd93f96cefaa26936c971e939b0fc5e838 + buildsystem: cmake-ninja + builddir: true + config-opts: + - -D BUILD_SHARED_LIBS=OFF + - -D OpenGL_GL_PREFERENCE=GLVND + - -D BUILD_TESTING=OFF + cleanup: + - /include + - /bin/dbf* + - /bin/shp* + - /lib/cmake + - /share/shapelib + - '*.a' + - '*.cmake' diff --git a/deploy/macos/MacOSXBundleInfo.plist.in b/deploy/macos/MacOSXBundleInfo.plist.in index 8db1444e74b..47d9cecbfd1 100644 --- a/deploy/macos/MacOSXBundleInfo.plist.in +++ b/deploy/macos/MacOSXBundleInfo.plist.in @@ -4,42 +4,61 @@ CFBundleDevelopmentRegion English + CFBundleExecutable ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile macx.icns + CFBundleIdentifier ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion 6.0 + CFBundleLongVersionString ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType APPL + CFBundleShortVersionString ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleSignature ???? + CFBundleVersion ${MACOSX_BUNDLE_BUNDLE_VERSION} + CSResourcesFileMapped + LSRequiresCarbon + NSHumanReadableCopyright ${MACOSX_BUNDLE_COPYRIGHT} + NSPrincipalClass NSApplication + NSCameraUsageDescription Camera devices used for FPV + NSMicrophoneUsageDescription Qt Multimedia for MacOS uses the camera and microphone. + NSLocationUsageDescription Location used for ground control station position + NSBluetoothAlwaysUsageDescription Bluetooth is used to connect to vehicles diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index c964bca697b..f8de606c22c 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -151,7 +151,12 @@ QGCApplication::QGCApplication(int &argc, char *argv[], bool unitTesting) setApplicationName(applicationName); setOrganizationName(QGC_ORG_NAME); setOrganizationDomain(QGC_ORG_DOMAIN); - setApplicationVersion(QString(QGC_APP_VERSION_STR)); +#ifdef QGC_DAILY_BUILD + setApplicationVersion(QGC_APP_TAG); +#else + setApplicationVersion(QGC_APP_VERSION); +#endif + #ifdef Q_OS_LINUX setWindowIcon(QIcon(":/res/qgroundcontrol.ico")); #endif diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ee1d75a6875..dea58864038 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,9 +4,6 @@ endif() find_package(Qt6 REQUIRED COMPONENTS Core Test) -include(CTest) -enable_testing() - # if(ANDROID) # include(AndroidTestUtilities) # endif() diff --git a/translations/qgc-lupdate.sh b/translations/qgc-lupdate.sh index 9bb933b3604..4837abf6812 100755 --- a/translations/qgc-lupdate.sh +++ b/translations/qgc-lupdate.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/bash + # This script will update both the Qt and Json string translation files. QT_PATH=~/Qt/6.8.1/*/bin $QT_PATH/lupdate ../src -ts qgc.ts -no-obsolete