diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -1,31 +1,61 @@ # Kirigami -Build the gallery example app on Android: -``` +## Build examples to desktop +Build all examples available +```sh mkdir build cd build +cmake .. -DBUILD_EXAMPLES=ON +make +``` +Than, you can run: +```sh +./examples/applicationitemapp/applicationitemapp +# or +./examples/galleryapp/kirigami2gallery +``` -cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/share/ECM/toolchain/Android.cmake -DQTANDROID_EXPORTED_TARGET=kirigami2gallery -DANDROID_APK_DIR=../examples/galleryapp/ -DCMAKE_PREFIX_PATH=/path/to/Qt5.7.0/5.7/android_armv7/ -DCMAKE_INSTALL_PREFIX=/path/to/dummy/install/prefix -DECM_DIR=/path/to/share/ECM/cmake -DBUILD_EXAMPLES=ON +## Build the gallery example app on Android: +Make sure to install **android-sdk**, **android-ndk** and **android-qt5-arch**, where **arch** should be the same architecture that you aim to deploy. +```sh +mkdir build +cd build +cmake .. \ + -DQTANDROID_EXPORTED_TARGET=kirigami2gallery \ + -DANDROID_APK_DIR=../examples/galleryapp \ + -DECM_DIR=/path/to/share/ECM/cmake \ + -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \ + -DECM_ADDITIONAL_FIND_ROOT_PATH=/path/to/Qt5.7.0/5.7/{arch} \ + -DCMAKE_PREFIX_PATH=/path/to/Qt5.7.0/5.7/{arch}/path/to/Qt5Core ``` -You need a `-DCMAKE_INSTALL_PREFIX` to somewhere in your home, but using an absolute path +You need a `-DCMAKE_INSTALL_PREFIX` to somewhere in your home, but using an absolute path. If you have a local checkout of the breeze-icons repo, you can avoid the cloning of the build dir by passing also `-DBREEZEICONS_DIR=/path/to/existing/sources/of/breeze-icons` ``` -make -make install make create-apk-kirigami2gallery ``` -`kirigamigallery_build_apk/bin/QtApp-debug.apk` will be generated +`./kirigami2gallery_build_apk/build/outputs/apk/kirigami2gallery_build_apk-debug.apk` will be generated -to directly install on a phone: +To directly install on a phone: ``` -adb install -r ./kirigami2gallery_build_apk/bin/QtApp-debug.apk +adb install -r ./kirigami2gallery_build_apk/build/outputs/apk/kirigami2gallery_build_apk-debug.apk ``` +To perform this, your device need to be configureted with `USB debugging` and `install via USB` in `Developer options`. +> Some ambient variables must be set before the process: `ANDROID_NDK`, `ANDROID_SDK_ROOT`, `Qt5_android` and `JAVA_HOME` +``` +export ANDROID_NDK=/path/to/android-ndk +export ANDROID_SDK_ROOT=/path/to/android-sdk +export Qt5_android=/path/to/android-qt5/5.7.0/{arch} +export PATH=$ANDROID_SDK_ROOT/platform-tools/:$PATH +# adapt the following path to your ant installation +export ANT=/usr/bin/ant +export JAVA_HOME=/path/to/lib/jvm/java-8-openjdk/ +``` # Build on your application Android, ship it together Kirigami 1) Build kirigami