Use CMake from qtutilities instead of ECM to create Android APK
This commit is contained in:
parent
0182e41ffa
commit
18e7e5d027
|
@ -148,30 +148,6 @@ set(REQUIRED_ICONS
|
||||||
system-search
|
system-search
|
||||||
window-close
|
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 c++utilities
|
||||||
find_package(c++utilities 4.10.0 REQUIRED)
|
find_package(c++utilities 4.10.0 REQUIRED)
|
||||||
|
@ -179,27 +155,17 @@ use_cpp_utilities()
|
||||||
include(BasicConfig)
|
include(BasicConfig)
|
||||||
|
|
||||||
# find qtutilities
|
# find qtutilities
|
||||||
if(QUICK_GUI)
|
find_package(qtutilities 5.11.0 REQUIRED)
|
||||||
find_package(qtutilities 5.11.0 REQUIRED)
|
use_qt_utilities()
|
||||||
use_qt_utilities()
|
|
||||||
elseif(WIDGETS_GUI)
|
|
||||||
find_package(qtutilities 5.7.0 REQUIRED)
|
|
||||||
use_qt_utilities()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# find passwordfile
|
# find passwordfile
|
||||||
find_package(passwordfile 3.1.0 REQUIRED)
|
find_package(passwordfile 3.1.0 REQUIRED)
|
||||||
use_password_file()
|
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
|
# require Qt AndroidExtras
|
||||||
if(ANDROID AND QUICK_GUI)
|
if(ANDROID AND QUICK_GUI)
|
||||||
list(APPEND ADDITIONAL_QT_MODULES AndroidExtras)
|
list(APPEND ADDITIONAL_QT_MODULES AndroidExtras)
|
||||||
|
list(APPEND ADDITIONAL_KF_MODULES Kirigami2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# include modules to apply configuration
|
# include modules to apply configuration
|
||||||
|
@ -210,6 +176,7 @@ endif()
|
||||||
|
|
||||||
include(WindowsResources)
|
include(WindowsResources)
|
||||||
include(AppTarget)
|
include(AppTarget)
|
||||||
|
include(AndroidApk)
|
||||||
include(ShellCompletion)
|
include(ShellCompletion)
|
||||||
include(ConfigHeader)
|
include(ConfigHeader)
|
||||||
|
|
||||||
|
|
21
README.md
21
README.md
|
@ -42,7 +42,6 @@ Build c++utilities, passwordfile, qtutilities and passwordmanager in one step to
|
||||||
```
|
```
|
||||||
# specify Android platform
|
# specify Android platform
|
||||||
_android_arch=arm64-v8a
|
_android_arch=arm64-v8a
|
||||||
_android_toolchain=aarch64-linux-android
|
|
||||||
_android_api_level=21
|
_android_api_level=21
|
||||||
|
|
||||||
# set project name
|
# set project name
|
||||||
|
@ -58,12 +57,8 @@ qt_root=/opt/android-qt5/$qt_version/$_android_arch
|
||||||
other_libs_root=/opt/android-libs/$_android_arch
|
other_libs_root=/opt/android-libs/$_android_arch
|
||||||
root="$android_ndk_root/sysroot;$other_libs_root;$qt_root"
|
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 \
|
cmake \
|
||||||
-DCMAKE_BUILD_TYPE=Debug \
|
-DCMAKE_BUILD_TYPE=Debug \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \
|
|
||||||
-DCMAKE_SYSTEM_NAME=Android \
|
-DCMAKE_SYSTEM_NAME=Android \
|
||||||
-DCMAKE_SYSTEM_VERSION=$_android_api_level \
|
-DCMAKE_SYSTEM_VERSION=$_android_api_level \
|
||||||
-DCMAKE_ANDROID_ARCH_ABI=$_android_arch \
|
-DCMAKE_ANDROID_ARCH_ABI=$_android_arch \
|
||||||
|
@ -73,32 +68,20 @@ cmake \
|
||||||
-DCMAKE_INSTALL_PREFIX=$other_libs_root \
|
-DCMAKE_INSTALL_PREFIX=$other_libs_root \
|
||||||
-DCMAKE_PREFIX_PATH="$root" \
|
-DCMAKE_PREFIX_PATH="$root" \
|
||||||
-DCMAKE_FIND_ROOT_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_DYNAMIC_INCLUDE_DIR="$other_libs_root/include" \
|
||||||
-Diconv_STATIC_INCLUDE_DIR="$other_libs_root/include" \
|
-Diconv_STATIC_INCLUDE_DIR="$other_libs_root/include" \
|
||||||
-Dcrypto_DYNAMIC_INCLUDE_DIR="$other_libs_root/include" \
|
-Dcrypto_DYNAMIC_INCLUDE_DIR="$other_libs_root/include" \
|
||||||
-Dcrypto_STATIC_INCLUDE_DIR="$other_libs_root/include" \
|
-Dcrypto_STATIC_INCLUDE_DIR="$other_libs_root/include" \
|
||||||
-Dcrypto_DYNAMIC_LIB="$other_libs_root/lib/libcrypto.so" \
|
-Dcrypto_DYNAMIC_LIB="$other_libs_root/lib/libcrypto.so" \
|
||||||
-Dcrypto_STATIC_LIB="$other_libs_root/lib/libcrypto.a" \
|
-Dcrypto_STATIC_LIB="$other_libs_root/lib/libcrypto.a" \
|
||||||
-DQt5Core_DIR="$qt_root/lib/cmake/Qt5Core" \
|
-DUSE_NATIVE_FILE_BUFFER=ON \
|
||||||
-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" \
|
|
||||||
-DNO_DOXYGEN=ON \
|
-DNO_DOXYGEN=ON \
|
||||||
-DWIDGETS_GUI=OFF \
|
-DWIDGETS_GUI=OFF \
|
||||||
-DQUICK_GUI=ON \
|
-DQUICK_GUI=ON \
|
||||||
-DBUILTIN_ICON_THEMES=breeze \
|
-DBUILTIN_ICON_THEMES=breeze \
|
||||||
-DBREEZEICONS_DIR="$PWD" \
|
|
||||||
$SOURCES/subdirs/$_reponame
|
$SOURCES/subdirs/$_reponame
|
||||||
|
|
||||||
make create-apk -j$(nproc)
|
make apk -j$(nproc)
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Notes
|
##### Notes
|
||||||
|
|
Loading…
Reference in New Issue