diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-10-13 15:46:24 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-10-13 19:44:45 +0000 |
commit | 557d2adbe88770fd1a03afbcf420c63877356970 (patch) | |
tree | 34ccbb4987b6dcd89b9dadf6aae7759b92111c20 /cmake/QtProcessConfigureArgs.cmake | |
parent | ba511b2fa4782d6618a5261bbbd50f0c57266a3a (diff) |
CMake: Autodetect Android toolchain file and NDK
The Android toolchain file is now autodetected from the location of the
NDK. The NDK location can be specified by setting the CMake variable
ANDROID_NDK_ROOT. Auto-detection of the Android toolchain file is the
only purpose of this variable.
In recent Android SDK installations the path to the NDK is well-known
and can be auto-detected too. If only ANDROID_SDK_ROOT is given, we try
to detect ANDROID_NDK_ROOT first and from that the Android toolchain
file.
Adjust the build instructions in cmake/README.md, and remove the part
where we suggest to set some environment variables that are only used to
create the cmake call.
Task-number: QTBUG-87068
Change-Id: Ia0df5df7651e98979e9cead1cdae7b17ecbc4afb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtProcessConfigureArgs.cmake')
-rw-r--r-- | cmake/QtProcessConfigureArgs.cmake | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 5fcc8aad90..a54edb3212 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -576,19 +576,7 @@ translate_string_input(qpa_default_platform QT_QPA_DEFAULT_PLATFORM) translate_list_input(sanitize ECM_ENABLE_SANITIZERS) translate_path_input(android-sdk ANDROID_SDK_ROOT) -if(DEFINED INPUT_android-ndk) - drop_input(android-ndk) - set(toolchain_file "${INPUT_android-ndk}/build/cmake/android.toolchain.cmake") - if(EXISTS "${toolchain_file}") - message("Using CMake toolchain file: ${toolchain_file}") - else() - qtConfAddError("The toolchain file '${toolchain_file}' does not exist. " - "This file path was deduced from the -android-ndk option. Consider specifying " - "the correct toolchain file with -- -DCMAKE_TOOLCHAIN_FILE=<path>") - endif() - push("-DCMAKE_TOOLCHAIN_FILE=${toolchain_file}") - unset(toolchain_file) -endif() +translate_path_input(android-ndk ANDROID_NDK_ROOT) if(DEFINED INPUT_android-ndk-host) drop_input(android-ndk-host) qtConfAddWarning("The -android-ndk-host option is not supported with the CMake build. " |