From 18e7e5d027b3d9343a5f9674805124541f9ecf08 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 16 Sep 2018 00:33:55 +0200 Subject: [PATCH] Use CMake from qtutilities instead of ECM to create Android APK --- CMakeLists.txt | 41 ++++------------------------------------- README.md | 21 ++------------------- 2 files changed, 6 insertions(+), 56 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e605d0..e011e2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,30 +148,6 @@ set(REQUIRED_ICONS system-search window-close ) -set(REQUIRED_ICONS_FOR_KIRIGAMI - application-menu - arrow-down - dialog-close - document-decrypt - edit - folder-sync - go-next-symbolic - go-next-symbolic-rtl - go-previous-symbolic - go-previous-symbolic-rtl - go-up - handle-sort - overflow-menu - overflow-menu-left - overflow-menu-right - view-left-close - view-left-new - view-list-icons - view-right-close - view-right-new - window-close - window-close-symbolic -) # find c++utilities find_package(c++utilities 4.10.0 REQUIRED) @@ -179,27 +155,17 @@ use_cpp_utilities() include(BasicConfig) # find qtutilities -if(QUICK_GUI) - find_package(qtutilities 5.11.0 REQUIRED) - use_qt_utilities() -elseif(WIDGETS_GUI) - find_package(qtutilities 5.7.0 REQUIRED) - use_qt_utilities() -endif() +find_package(qtutilities 5.11.0 REQUIRED) +use_qt_utilities() # find passwordfile find_package(passwordfile 3.1.0 REQUIRED) use_password_file() -# require additional icons when using Kirigami -if(QUICK_QUI) - list(APPEND REQUIRED_ICONS ${REQUIRED_ICONS_FOR_KIRIGAMI}) - list(REMOVE_DUPLICATES REQUIRED_ICONS) -endif() - # require Qt AndroidExtras if(ANDROID AND QUICK_GUI) list(APPEND ADDITIONAL_QT_MODULES AndroidExtras) + list(APPEND ADDITIONAL_KF_MODULES Kirigami2) endif() # include modules to apply configuration @@ -210,6 +176,7 @@ endif() include(WindowsResources) include(AppTarget) +include(AndroidApk) include(ShellCompletion) include(ConfigHeader) diff --git a/README.md b/README.md index d50512c..d30b82c 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,6 @@ Build c++utilities, passwordfile, qtutilities and passwordmanager in one step to ``` # specify Android platform _android_arch=arm64-v8a -_android_toolchain=aarch64-linux-android _android_api_level=21 # set project name @@ -58,12 +57,8 @@ qt_root=/opt/android-qt5/$qt_version/$_android_arch other_libs_root=/opt/android-libs/$_android_arch root="$android_ndk_root/sysroot;$other_libs_root;$qt_root" -# use Breeze icons from 'breeze-icons' package -ln -s /usr/share/icons/breeze icons - cmake \ -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \ -DCMAKE_SYSTEM_NAME=Android \ -DCMAKE_SYSTEM_VERSION=$_android_api_level \ -DCMAKE_ANDROID_ARCH_ABI=$_android_arch \ @@ -73,32 +68,20 @@ cmake \ -DCMAKE_INSTALL_PREFIX=$other_libs_root \ -DCMAKE_PREFIX_PATH="$root" \ -DCMAKE_FIND_ROOT_PATH="$root" \ - -DANDROID_API_LEVEL=$_android_api_level \ - -DANDROID_ABI=$_android_arch \ - -DANDROID_ARCHITECTURE=${_android_arch%-*} \ - -DANDROID_SDK_ROOT="$android_sdk_root" \ - -DANDROID_APK_DIR=$SOURCES/$_reponame/android \ - -DANDROID_TOOLCHAIN=$_android_toolchain \ - -DANDROID_COMPILER_PREFIX=$_android_toolchain \ - -DANDROID_SDK_BUILD_TOOLS_REVISION="$build_tools_version" \ - -DQTANDROID_EXPORTED_TARGET=$_pkgname \ -Diconv_DYNAMIC_INCLUDE_DIR="$other_libs_root/include" \ -Diconv_STATIC_INCLUDE_DIR="$other_libs_root/include" \ -Dcrypto_DYNAMIC_INCLUDE_DIR="$other_libs_root/include" \ -Dcrypto_STATIC_INCLUDE_DIR="$other_libs_root/include" \ -Dcrypto_DYNAMIC_LIB="$other_libs_root/lib/libcrypto.so" \ -Dcrypto_STATIC_LIB="$other_libs_root/lib/libcrypto.a" \ - -DQt5Core_DIR="$qt_root/lib/cmake/Qt5Core" \ - -DECM_ADDITIONAL_FIND_ROOT_PATH="$PWD/c++utilities;$PWD/passwordfile;$PWD/qtutilities;$root;$other_libs_root/lib;$other_libs_root/lib" \ - -DANDROID_EXTRA_LIBS="$other_libs_root/lib/libcrypto.so;$other_libs_root/lib/libssl.so;$other_libs_root/lib/libiconv.so;$other_libs_root/lib/libKF5Kirigami2.so" \ + -DUSE_NATIVE_FILE_BUFFER=ON \ -DNO_DOXYGEN=ON \ -DWIDGETS_GUI=OFF \ -DQUICK_GUI=ON \ -DBUILTIN_ICON_THEMES=breeze \ - -DBREEZEICONS_DIR="$PWD" \ $SOURCES/subdirs/$_reponame -make create-apk -j$(nproc) +make apk -j$(nproc) ``` ##### Notes