Changeset View
Changeset View
Standalone View
Standalone View
toolchain/Android.cmake
| Show All 21 Lines | |||||
| 22 | # This module requires CMake 3.7. | 22 | # This module requires CMake 3.7. | ||
| 23 | # | 23 | # | ||
| 24 | # Since 1.7.0. | 24 | # Since 1.7.0. | ||
| 25 | # | 25 | # | ||
| 26 | # Usage | 26 | # Usage | ||
| 27 | # ===== | 27 | # ===== | ||
| 28 | # | 28 | # | ||
| 29 | # To use this file, you need to set the ``CMAKE_TOOLCHAIN_FILE`` to point to | 29 | # To use this file, you need to set the ``CMAKE_TOOLCHAIN_FILE`` to point to | ||
| 30 | # ``AndroidToolchain.cmake`` on the command line:: | 30 | # ``Android.cmake`` on the command line:: | ||
| 31 | # | 31 | # | ||
| 32 | # cmake -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/AndroidToolchain.cmake | 32 | # cmake -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake | ||
| 33 | # | 33 | # | ||
| 34 | # You will also need to provide the locations of the Android NDK and SDK. This | 34 | # You will also need to provide the locations of the Android NDK and SDK. This | ||
| 35 | # can be done on the commandline or with environment variables; in either case | 35 | # can be done on the commandline or with environment variables; in either case | ||
| 36 | # the variable names are: | 36 | # the variable names are: | ||
| 37 | # | 37 | # | ||
| 38 | # ``CMAKE_ANDROID_NDK`` | 38 | # ``CMAKE_ANDROID_NDK`` | ||
| 39 | # The NDK root path. | 39 | # The NDK root path. | ||
| 40 | # ``ANDROID_SDK_ROOT`` | 40 | # ``ANDROID_SDK_ROOT`` | ||
| Show All 20 Lines | |||||
| 61 | # prefixes of those libraries would be passed as alternative roots as list via | 61 | # prefixes of those libraries would be passed as alternative roots as list via | ||
| 62 | # ``ECM_ADDITIONAL_FIND_ROOT_PATH``. Since 5.30.0. | 62 | # ``ECM_ADDITIONAL_FIND_ROOT_PATH``. Since 5.30.0. | ||
| 63 | # | 63 | # | ||
| 64 | # For example, for integrating a Qt5 for Android with armv7 target present at | 64 | # For example, for integrating a Qt5 for Android with armv7 target present at | ||
| 65 | # ``/opt/android/Qt5/5.7/android_armv7`` and some other libraries installed to | 65 | # ``/opt/android/Qt5/5.7/android_armv7`` and some other libraries installed to | ||
| 66 | # the prefix ``/opt/android/foo``, you would use:: | 66 | # the prefix ``/opt/android/foo``, you would use:: | ||
| 67 | # | 67 | # | ||
| 68 | # cmake \ | 68 | # cmake \ | ||
| 69 | # -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/AndroidToolchain.cmake \ | 69 | # -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \ | ||
| 70 | # -DECM_ADDITIONAL_FIND_ROOT_PATH="/opt/android/Qt5/5.7/android_armv7;/opt/android/foo" | 70 | # -DECM_ADDITIONAL_FIND_ROOT_PATH="/opt/android/Qt5/5.7/android_armv7;/opt/android/foo" | ||
| 71 | # | 71 | # | ||
| 72 | # If your project uses ``find_package()`` to locate build tools on the host | 72 | # If your project uses ``find_package()`` to locate build tools on the host | ||
| 73 | # system, make sure to pass ``CMAKE_FIND_ROOT_PATH_BOTH`` or | 73 | # system, make sure to pass ``CMAKE_FIND_ROOT_PATH_BOTH`` or | ||
| 74 | # ``NO_CMAKE_FIND_ROOT_PATH`` as argument in the call. See the | 74 | # ``NO_CMAKE_FIND_ROOT_PATH`` as argument in the call. See the | ||
| 75 | # ``find_package()`` documentation for more details. | 75 | # ``find_package()`` documentation for more details. | ||
| 76 | # | 76 | # | ||
| 77 | # Deploying Qt Applications | 77 | # Deploying Qt Applications | ||
| 78 | # ========================= | 78 | # ========================= | ||
| 79 | # | 79 | # | ||
| 80 | # After building the application, you will need to generate an APK that can be | 80 | # After building the application, you will need to generate an APK that can be | ||
| 81 | # deployed to an Android device. This module integrates androiddeployqt support | 81 | # deployed to an Android device. This module integrates androiddeployqt support | ||
| 82 | # to help with this for Qt-based projects. To enable this, set the | 82 | # to help with this for Qt-based projects. To enable this, set the | ||
| 83 | # ``QTANDROID_EXPORTED_TARGET`` variable to the targets you wish to export as an | 83 | # ``QTANDROID_EXPORTED_TARGET`` variable to the targets you wish to export as an | ||
| 84 | # APK (in a ;-separed list), as well as ``ANDROID_APK_DIR`` to a directory | 84 | # APK (in a ;-separed list), as well as ``ANDROID_APK_DIR`` to a directory | ||
| 85 | # containing some basic information. This will create a ``create-apk-<target>`` | 85 | # containing some basic information. This will create a ``create-apk-<target>`` | ||
| 86 | # target that will generate the APK file. See the `Qt on Android deployment | 86 | # target that will generate the APK file. See the `Qt on Android deployment | ||
| 87 | # documentation <http://doc.qt.io/qt-5/deployment-android.html>`_ for more | 87 | # documentation <http://doc.qt.io/qt-5/deployment-android.html>`_ for more | ||
| 88 | # information. | 88 | # information. | ||
| 89 | # | 89 | # | ||
| 90 | # For example, you could do:: | 90 | # For example, you could do:: | ||
| 91 | # | 91 | # | ||
| 92 | # cmake \ | 92 | # cmake \ | ||
| 93 | # -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/AndroidToolchain.cmake \ | 93 | # -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \ | ||
| 94 | # -DQTANDROID_EXPORTED_TARGET=myapp \ | 94 | # -DQTANDROID_EXPORTED_TARGET=myapp \ | ||
| 95 | # -DANDROID_APK_DIR=myapp-apk | 95 | # -DANDROID_APK_DIR=myapp-apk | ||
| 96 | # make | 96 | # make | ||
| 97 | # make create-apk-myapp | 97 | # make create-apk-myapp | ||
| 98 | # | 98 | # | ||
| 99 | # The APK would then be found in ``myapp_build_apk/bin`` in the build directory. | 99 | # The APK would then be found in ``myapp_build_apk/bin`` in the build directory. | ||
| 100 | # | 100 | # | ||
| 101 | # The create-apk-myapp target will be able to take an ARGS parameter with further | 101 | # The create-apk-myapp target will be able to take an ARGS parameter with further | ||
| ▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines | |||||