Skip to content

Commit a981fe6

Browse files
committed
Add ability to specify keypass param to androiddeployqt
1 parent dd6ad59 commit a981fe6

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

AddQtAndroidApk.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ include(CMakeParseArguments)
6060
# PACKAGE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/my-android-sources
6161
# KEYSTORE ${CMAKE_CURRENT_LIST_DIR}/mykey.keystore myalias
6262
# KEYSTORE_PASSWORD xxxx
63+
# KEY_PASSWORD xxxx
6364
# DEPENDS a_linked_target "path/to/a_linked_library.so" ...
6465
# INSTALL
6566
#)
6667
#
6768
macro(add_qt_android_apk TARGET SOURCE_TARGET)
6869

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

7273
# extract the full path of the source target binary
7374
set(QT_ANDROID_APP_PATH "$<TARGET_FILE:${SOURCE_TARGET}>") # full file path to the app's main shared library
@@ -262,7 +263,7 @@ macro(add_qt_android_apk TARGET SOURCE_TARGET)
262263
if(ARG_KEYSTORE)
263264
set(SIGN_OPTIONS --sign ${ARG_KEYSTORE})
264265
if(ARG_KEYSTORE_PASSWORD)
265-
set(SIGN_OPTIONS ${SIGN_OPTIONS} --storepass ${ARG_KEYSTORE_PASSWORD})
266+
set(SIGN_OPTIONS ${SIGN_OPTIONS} --keypass ${ARG_KEY_PASSWORD} --storepass ${ARG_KEYSTORE_PASSWORD})
266267
endif()
267268
endif()
268269

readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,19 @@ add_qt_android_apk(my_app_apk my_app
168168
)
169169
```
170170

171+
### KEY_PASSWORD
172+
173+
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.
174+
175+
Example:
176+
177+
```cmake
178+
add_qt_android_apk(my_app_apk my_app
179+
KEYSTORE ${CMAKE_CURRENT_LIST_DIR}/mykey.keystore myalias
180+
KEY_PASSWORD xxxxx
181+
)
182+
```
183+
171184
### DEPENDS
172185

173186
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.

0 commit comments

Comments
 (0)