diff --git a/CMakeLists.txt b/CMakeLists.txt index 154b28173c4..80f6b72d036 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,7 @@ set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +# set(CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG ON) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release") if(NOT CMAKE_BUILD_TYPE) @@ -137,13 +138,15 @@ endif() if(ANDROID) cmake_print_variables(QT_ANDROID_APPLICATION_ARGUMENTS QT_HOST_PATH) - # QT_USE_TARGET_ANDROID_BUILD_DIR + # 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) + # QT_ANDROID_SIGN_AAB if(QT_ANDROID_SIGN_APK) message(STATUS "Signing APK") message(STATUS "QT_ANDROID_KEYSTORE_PATH $ENV{QT_ANDROID_KEYSTORE_PATH}") @@ -207,6 +210,8 @@ qt_policy( SET QTP0005 NEW ) +# QT_TARGETS_FOLDER + ####################################################### # QGroundControl Options ####################################################### @@ -384,7 +389,7 @@ elseif(IOS) 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} + set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES QT_IOS_LAUNCH_SCREEN ${CMAKE_SOURCE_DIR}/deploy/ios/QGCLaunchScreen.xib XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.mavlink.qgroundcontrol" @@ -398,6 +403,9 @@ elseif(IOS) XCODE_ATTRIBUTE_INFOPLIST_KEY_LSApplicationCategoryType "public.app-category.mycategory" XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES" ) + + # set(QT_NO_FFMPEG_XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON) + # qt_add_ios_ffmpeg_libraries(CMAKE_PROJECT_NAME) elseif(ANDROID) FetchContent_Declare(android_openssl DOWNLOAD_EXTRACT_TIMESTAMP true @@ -445,17 +453,23 @@ elseif(ANDROID) endif() endif() - set_target_properties(${PROJECT_NAME} + set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES # QT_ANDROID_ABIS ${ANDROID_ABI} QT_ANDROID_MIN_SDK_VERSION ${QGC_QT_ANDROID_MIN_SDK_VERSION} QT_ANDROID_TARGET_SDK_VERSION ${QGC_QT_ANDROID_TARGET_SDK_VERSION} + QT_ANDROID_PACKAGE_NAME "${QGC_ANDROID_PACKAGE_NAME}" QT_ANDROID_PACKAGE_SOURCE_DIR "${QGC_ANDROID_PACKAGE_SOURCE_DIR}" QT_ANDROID_VERSION_NAME ${CMAKE_PROJECT_VERSION} QT_ANDROID_VERSION_CODE ${ANDROID_VERSION_CODE} # QT_QML_ROOT_PATH ${CMAKE_SOURCE_DIR} + # QT_ANDROID_SDK_BUILD_TOOLS_REVISION + # QT_ANDROID_SYSTEM_LIBS_PREFIX ) # get_target_property(QGC_ANDROID_DEPLOY_FILE ${PROJECT_NAME} QT_ANDROID_DEPLOYMENT_SETTINGS_FILE) + # QT_ANDROID_DEPLOYMENT_DEPENDENCIES + + cmake_print_variables(QGC_ANDROID_PACKAGE_NAME) elseif(LINUX) endif() diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 0cb949ee05d..c124432717e 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,6 +1,5 @@ diff --git a/android/build.gradle b/android/build.gradle index e3b2174a83f..d62f86b1a00 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,21 +5,22 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:8.7.2' + classpath 'com.android.tools.build:gradle:8.7.3' } } repositories { google() mavenCentral() - maven { url 'https://jitpack.io' } + maven { url = 'https://jitpack.io' } } -apply plugin: 'com.android.application' +apply plugin: qtGradlePluginType dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) - implementation 'androidx.core:core:1.12.0' + //noinspection GradleDependency + implementation 'androidx.core:core:1.13.1' implementation 'com.github.mik3y:usb-serial-for-android:3.8.1' } @@ -40,12 +41,14 @@ android { * Changing them manually might break the compilation! *******************************************************/ + // namespace = androidPackageName + namespace = "org.mavlink.qgroundcontrol" compileSdkVersion androidCompileSdkVersion buildToolsVersion androidBuildToolsVersion - ndkVersion androidNdkVersion + ndkVersion = androidNdkVersion // Extract native libraries from the APK - packagingOptions.jniLibs.useLegacyPackaging true + packagingOptions.jniLibs.useLegacyPackaging = true sourceSets { main { @@ -74,7 +77,7 @@ android { } lintOptions { - abortOnError false + abortOnError = false } // Do not compress Qt binary resources file @@ -88,7 +91,7 @@ android { targetSdkVersion qtTargetSdkVersion ndk.abiFilters = qtTargetAbiList.split(",") - namespace "org.mavlink.qgroundcontrol" + // namespace "org.mavlink.qgroundcontrol" // versionName "5.0" // versionCode timestampInt @@ -101,6 +104,7 @@ android { } println "timestamp: " + getTimestampStr() + println "androidPackageName: ${namespace}" println "androidCompileSdkVersion: ${compileSdkVersion}" println "androidBuildToolsVersion: ${buildToolsVersion}" println "androidNdkVersion: ${ndkVersion}" diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index df97d72b8b9..cea7a793a84 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/cmake/CustomOptions.cmake b/cmake/CustomOptions.cmake index 5f1738c7da3..8fc1a492fc4 100644 --- a/cmake/CustomOptions.cmake +++ b/cmake/CustomOptions.cmake @@ -30,8 +30,10 @@ option(QGC_ENABLE_QT_VIDEOSTREAMING "Enable QtMultimedia Video Backend" OFF) # Q 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") -set(QGC_QT_ANDROID_MIN_SDK_VERSION "26" CACHE STRING "Android Min SDK Version") +# 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") # MacOS set(QGC_BUNDLE_ID "org.qgroundcontrol.QGroundControl" CACHE STRING "MacOS Bundle ID") # MACOS diff --git a/cmake/printSummary.cmake b/cmake/printSummary.cmake index 8e0d211efd6..278ea46b766 100644 --- a/cmake/printSummary.cmake +++ b/cmake/printSummary.cmake @@ -63,6 +63,11 @@ message( STATUS "MacOS Bundle ID: ${QGC_BUNDLE_ID}" ) message( STATUS "MacOS Icon Path: ${QGC_MACOS_ICON_PATH}" ) endif() +if(ANDROID) +message( STATUS "Android NDK Host System ${ANDROID_NDK_HOST_SYSTEM_NAME}" ) +message( STATUS "Android SDK Root ${ANDROID_SDK_ROOT}" ) +endif() + OptionOutput( "Stable Build: " QGC_STABLE_BUILD ) OptionOutput( "Building Tests: " QGC_BUILD_TESTING AND BUILD_TESTING ) OptionOutput( "Debug QML: " QGC_DEBUG_QML )