Skip to content

Commit

Permalink
Work on CMake support
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Feb 2, 2024
1 parent 9b97c1e commit e5af618
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/builds_mobile_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ jobs:
base64 -d release.keystore.base64 > release.keystore
${{env.QT_HOST_PATH}}/bin/androiddeployqt --input build/android-${{env.APP_NAME}}-deployment-settings.json --output build/android-build/ --android-platform android-34 --aab --release --sign release.keystore ${{ secrets.ANDROID_SIGNINGKEY_ALIAS }} --storepass ${{ secrets.ANDROID_SIGNINGKEY_PASSWORD }}
# Upload Android app bundle (GitHub CI)
- name: Upload Android app bundle (GitHub CI)
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-${{env.APP_VERSION}}-Android.aab
path: build/android-build/build/outputs/bundle/release/android-build-release.aab

# Upload Android app bundle (Play Store)
- name: Upload Android app bundle (Play Store)
run: |
Expand All @@ -164,13 +171,6 @@ jobs:
mv assets/android/fastlane/ fastlane/
fastlane android deploy
# Upload Android app bundle (GitHub CI)
- name: Upload Android app bundle (GitHub CI)
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-${{env.APP_VERSION}}-Android.aab
path: build/android-build/build/outputs/bundle/release/android-build-release.aab

## iOS build #################################################################
build-ios:
name: "iOS CI build"
Expand Down
30 changes: 18 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,37 @@ target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC src/thirdparty/)

## Android
if(ANDROID)
set(QT_ANDROID_ABIS "armeabi-v7a;arm64-v8a;x86;x86_64")
set(QT_ANDROID_BUILD_ALL_ABIS ON)
set(QT_ANDROID_MIN_SDK_VERSION 23)
set(QT_ANDROID_TARGET_SDK_VERSION 34)
set(QT_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/assets/android/")
set_target_properties(QmlAppTemplate PROPERTIES
QT_ANDROID_ABIS "armeabi-v7a;arm64-v8a;x86;x86_64"
QT_ANDROID_BUILD_ALL_ABIS ON
QT_ANDROID_MIN_SDK_VERSION 23
QT_ANDROID_TARGET_SDK_VERSION 34
QT_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/assets/android/"
)
endif()

if (APPLE)
set(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "io.emeric.qmlapptemplate")
set(CMAKE_XCODE_ATTRIBUTE_MARKETING_VERSION "${PROJECT_VERSION}")

set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Development")
set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "")
endif()

## macOS
if(APPLE AND NOT IOS)
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
set(CMAKE_XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/assets/ios/Info.plist")

set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Development")
set(CMAKE_XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/assets/macos/Info.plist")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/assets/macos/${CMAKE_PROJECT_NAME}.entitlements")
endif()

## iOS
if(IOS)
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 14.0)
set(CMAKE_XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/assets/ios/Info.plist")

set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Development")
set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") # iPhone,iPad
endif()

## Windows
Expand Down

0 comments on commit e5af618

Please sign in to comment.