diff --git a/.gitmodules b/.gitmodules index 85820ee..8effaf6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "DoxyStyle"] path = DoxyStyle url = https://github.com/QuasarApp/DoxyStyle.git +[submodule "crossplatform/qt-android-cmake"] + path = qt-android-cmake + url = https://github.com/LaurentGomila/qt-android-cmake.git diff --git a/Docs/QuasarAppCITargets.md b/Docs/QuasarAppCITargets.md index 226fc22..052e14b 100644 --- a/Docs/QuasarAppCITargets.md +++ b/Docs/QuasarAppCITargets.md @@ -7,7 +7,7 @@ This module implementation next cmake functions: --- - ## Testing +## Testing --- **addTestsArg** (name testExec arg) - Name target for test utility of your application. @@ -23,7 +23,7 @@ This module implementation next cmake functions: --- - ## Deployment +## Deployment --- **addDeploy** (name targets targetDir) - Add deploy target for deployed your application via CqtDeployer tool. @@ -49,17 +49,21 @@ This module implementation next cmake functions: **addDeployAPK** (name input aliase keystore keystorePass targetDir) - Add subtargets of deploy setep for create signed android apk file. - name - This is prefix of added subtarget (any word). - - input - Path to input android json file: *-deployment-settings.json. + - android_src - Path to folder with the android_manifest file. - aliase - Alise for key store. - keystore - Path of key store. - keystorePass - Pass of keystore file. - targetDir - Target directory for output apk file. +**add_qt_android_apk** (my_app_apk my_app) - This target add targets for the build apk file. +For get more information about this function see oficial [documentation](https://github.com/LaurentGomila/qt-android-cmake#options-of-the-add_qt_android_apk-macro +) of the **qt-android-cmake** toolchain. + **initDeploy** - Create a main deploy target for all addDeploy subtargets. This method need to call before invoiced of all addDeploy methods. --- - ## Release +## Release --- **initRelease** - Сreate the general release target for all subtargets addRelease. This method need to call before invoice all addRelease methods. @@ -74,11 +78,11 @@ This module implementation next cmake functions: --- - ## Dcumentation +## Dcumentation --- **initDoc** - Create the general doc target for all subtargets addDoc. This method need to call before invoice all addDoc methods. **addDoc** (name doxygenFile) - Create subtargets for generate documentation of cpp code. - name - This is prefix of added subtarget (any word). - - doxygenFile - This is path to doxygen configuration file. \ No newline at end of file + - doxygenFile - This is path to doxygen configuration file. diff --git a/Docs/crossplatform.md b/Docs/crossplatform.md index 846ca25..b30bfc5 100644 --- a/Docs/crossplatform.md +++ b/Docs/crossplatform.md @@ -4,7 +4,7 @@ This module include crossplatform toolchains by target platform. To select target platform set the TARGET_PLATFORM_TOOLCHAIN define. **Availabel platforms:** -* wasm32 +* wasm32 - use the initWasmSupport function * win32-g++ * win64-g++ @@ -14,4 +14,6 @@ For add full support of the wasm32 build you shold use the initWasmSupport metho **initWasmSupport** (name deployFile) - This method prepare static build for wasm executable and qt resources. * name - This is name of your initialize targets. You can set it as a CMAKE_PROJECT -* deployFile - This is path to the deploy file of the cqtdepoyer tool. Use it for deploy your site. \ No newline at end of file +* deployFile - This is path to the deploy file of the cqtdepoyer tool. Use it for deploy your site. + + diff --git a/QuasarAppCITargets.cmake b/QuasarAppCITargets.cmake index 4335bdc..1c6d558 100644 --- a/QuasarAppCITargets.cmake +++ b/QuasarAppCITargets.cmake @@ -50,7 +50,7 @@ # # addDeployAPK(name input aliase keystore keystorePass targetDir) // Add subtargets of deploy setep for create signed android apk file. # - name - This is prefix of added subtarget (any word). -# - input - Path to input android json file : *-deployment-settings.json +# - android_src - Path to folder with the android_manifest file. # - aliase - Aliase for key store. # - keystore - Path of key store. # - keystorePass - Pass of keystore file. @@ -92,6 +92,10 @@ set(DEPLOY_TARGETS_LIST "") set(RELEASE_TARGETS_LIST "") set(DIR_FOR_TESTING ${PROJECT_SOURCE_DIR}/Testing) +if (ANDROID) + include(${CMAKE_CURRENT_LIST_DIR}/qt-android-cmake/AddQtAndroidApk.cmake) +endif() + function(emptyTarget targetName) if(TARGET ${targetName}) @@ -373,7 +377,7 @@ function(addDeployQIF name sourceDir targetDir config) endfunction() -function(addDeployAPK name input aliase keystore keystorePass targetDir) +function(addDeployAPK name android_src aliase keystore keystorePass targetDir) if(TARGET deployAPK${name}) message("the deployAPK${name} target already created!") @@ -386,19 +390,11 @@ function(addDeployAPK name input aliase keystore keystorePass targetDir) return() endif() - - set(OUTPUT_ANDROID --output "${CMAKE_BINARY_DIR}/AndroidBuild") - set(INPUT_ANDROID --input "${input}") - set(JDK --jdk /usr) - set(SIGN --sign "${keystore}" --storepass ${keystorePass} --keypass ${keystorePass} --release) - - find_program(A_DEPLOYER androiddeployqt) - - ADD_CUSTOM_TARGET( - createAPK${name} - COMMAND ${A_DEPLOYER} ${INPUT_ANDROID} ${OUTPUT_ANDROID} ${JDK} --gradle ${SIGN} - COMMENT "Run deploy android apk : ${A_DEPLOYER} ${INPUT_ANDROID} ${OUTPUT_ANDROID} ${JDK} --gradle ${SIGN}" - ) + add_qt_android_apk(createAPK${name} ${name} + PACKAGE_SOURCES ${android_src} + KEYSTORE ${keystore} ${aliase} + KEYSTORE_PASSWORD ${keystorePass} + ) ADD_CUSTOM_TARGET( deployAPK${name} diff --git a/qt-android-cmake b/qt-android-cmake new file mode 160000 index 0000000..5a62962 --- /dev/null +++ b/qt-android-cmake @@ -0,0 +1 @@ +Subproject commit 5a62962dbe35e955374688461784ddb7f757a377