Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AddQtAndroidApk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ include(CMakeParseArguments)
# PACKAGE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/my-android-sources
# KEYSTORE ${CMAKE_CURRENT_LIST_DIR}/mykey.keystore myalias
# KEYSTORE_PASSWORD xxxx
# KEY_PASSWORD xxxx
# DEPENDS a_linked_target "path/to/a_linked_library.so" ...
# INSTALL
#)
#
macro(add_qt_android_apk TARGET SOURCE_TARGET)

# parse the macro arguments
cmake_parse_arguments(ARG "INSTALL" "NAME;VERSION_CODE;PACKAGE_NAME;PACKAGE_SOURCES;KEYSTORE_PASSWORD" "DEPENDS;KEYSTORE;APK_BUILD_TYPE" ${ARGN})
cmake_parse_arguments(ARG "INSTALL" "NAME;VERSION_CODE;PACKAGE_NAME;PACKAGE_SOURCES;KEYSTORE_PASSWORD;KEY_PASSWORD" "DEPENDS;KEYSTORE;APK_BUILD_TYPE" ${ARGN})

# extract the full path of the source target binary
set(QT_ANDROID_APP_PATH "$<TARGET_FILE:${SOURCE_TARGET}>") # full file path to the app's main shared library
Expand Down Expand Up @@ -262,7 +263,7 @@ macro(add_qt_android_apk TARGET SOURCE_TARGET)
if(ARG_KEYSTORE)
set(SIGN_OPTIONS --sign ${ARG_KEYSTORE})
if(ARG_KEYSTORE_PASSWORD)
set(SIGN_OPTIONS ${SIGN_OPTIONS} --storepass ${ARG_KEYSTORE_PASSWORD})
set(SIGN_OPTIONS ${SIGN_OPTIONS} --keypass ${ARG_KEY_PASSWORD} --storepass ${ARG_KEYSTORE_PASSWORD})
endif()
endif()

Expand Down
13 changes: 13 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ add_qt_android_apk(my_app_apk my_app
)
```

### KEY_PASSWORD

The password associated to the given key. Note that this option is only considered if the ```KEYSTORE``` argument is used. If it is not given, the password will be asked directly in the console at build time.

Example:

```cmake
add_qt_android_apk(my_app_apk my_app
KEYSTORE ${CMAKE_CURRENT_LIST_DIR}/mykey.keystore myalias
KEY_PASSWORD xxxxx
)
```

### DEPENDS

A list of dependencies (libraries) to be included into the APK. All the dependencies of the application must be listed here; if one is missing, the deployed application will fail to run on the device. The listed items can be either target names, or library paths.
Expand Down