Skip to content

Commit

Permalink
CMake: Set some Qt6.8 properties
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Jan 8, 2025
1 parent 4a1adfa commit a158f7b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
16 changes: 14 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}")
Expand Down Expand Up @@ -207,6 +210,8 @@ qt_policy(
SET QTP0005 NEW
)

# QT_TARGETS_FOLDER

#######################################################
# QGroundControl Options
#######################################################
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -450,12 +458,16 @@ elseif(ANDROID)
# 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
elseif(LINUX)

endif()
Expand Down
1 change: 0 additions & 1 deletion android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mavlink.qgroundcontrol"
android:installLocation="auto"
android:versionCode="-- %%INSERT_VERSION_CODE%% --"
android:versionName="-- %%INSERT_VERSION_NAME%% --">
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.7.2'
classpath 'com.android.tools.build:gradle:8.7.3'
}
}

Expand Down Expand Up @@ -88,7 +88,7 @@ android {
targetSdkVersion qtTargetSdkVersion
ndk.abiFilters = qtTargetAbiList.split(",")

namespace "org.mavlink.qgroundcontrol"
// namespace "org.mavlink.qgroundcontrol"
// versionName "5.0"
// versionCode timestampInt

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions cmake/CustomOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,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")

# Android
set(QGC_QT_ANDROID_MIN_SDK_VERSION "26" 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
Expand Down
5 changes: 5 additions & 0 deletions cmake/printSummary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit a158f7b

Please sign in to comment.