Skip to content

Commit

Permalink
Deployment Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Jan 19, 2025
1 parent 866c5c0 commit b705d6a
Show file tree
Hide file tree
Showing 15 changed files with 207 additions and 195 deletions.
14 changes: 0 additions & 14 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -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
34 changes: 0 additions & 34 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -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).)*$'
...
9 changes: 6 additions & 3 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
format:
tab_size: 4
line_width: 100
---
line_width: 120
tab_size: 4
max_prefix_chars: 40
use_tabchars: false
...
7 changes: 2 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Ignore Git repository files
.git
.gitignore
.gitattributes

# Ignore node_modules or other build artifacts
node_modules
Expand All @@ -10,8 +11,4 @@ build
Dockerfile*
docker-compose.yml

# Ignore OS-specific files
.DS_Store
*.swp

CMakeLists.txt.user*
README.md
11 changes: 3 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
20 changes: 20 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -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 }}
31 changes: 31 additions & 0 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
@@ -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 }}
11 changes: 11 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -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
127 changes: 62 additions & 65 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ if(APPLE AND NOT IOS)
set(MACOS TRUE)
endif()

if(APPLE)
enable_language(OBJC)
endif()

#######################################################
# CMake Configuration Options
#######################################################
Expand All @@ -62,7 +66,7 @@ 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)
Expand Down Expand Up @@ -138,11 +142,6 @@ endif()
# Qt6 Configuration
#######################################################

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

set(QT_SILENCE_MISSING_DEPENDENCY_TARGET_WARNING ON)
set(QT_MINIMUM_VERSION 6.8.1)

find_program(QMAKE_EXECUTABLE NAMES qmake HINTS ${QT_ROOT_DIR} ${QTDIR} ENV QTDIR PATH_SUFFIXES bin)
Expand All @@ -151,83 +150,38 @@ 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
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)
Expand All @@ -248,6 +202,46 @@ qt_policy(
SET QTP0005 NEW
)

set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml" CACHE PATH "Install path for QML" FORCE)
set(QML_IMPORT_PATH "${CMAKE_SOURCE_DIR}/src" CACHE STRING "Extra QML Import Paths" FORCE)
# set(QT_SILENCE_MISSING_DEPENDENCY_TARGET_WARNING ON)

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

#######################################################
# QGroundControl Options
#######################################################
Expand All @@ -259,8 +253,9 @@ 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)
set(BUILD_TESTING ON CACHE INTERNAL "" FORCE)
else()
set(BUILD_TESTING OFF CACHE INTERNAL "")
set(BUILD_TESTING OFF CACHE INTERNAL "" FORCE)
endif()

# option(QGC_DISABLE_MAVLINK_INSPECTOR "Disable Mavlink Inspector" OFF) # This removes QtCharts which is GPL licensed
Expand Down Expand Up @@ -400,8 +395,8 @@ 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_INFO_PLIST "${CMAKE_SOURCE_DIR}/deploy/macos/MacOSXBundleInfo.plist.in"
Expand All @@ -415,8 +410,6 @@ 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")
Expand Down Expand Up @@ -540,10 +533,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(
Expand Down
File renamed without changes.
Loading

0 comments on commit b705d6a

Please sign in to comment.