From d4470e16808a64f3b18b5f00536be2a7bc7f82d4 Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Tue, 12 May 2020 20:38:05 +0200 Subject: [PATCH] Use env var ANDROID_SDK or ANDROID_SDK_ROOT Hello, I have noticed on two platforms (linux and mac) that your project asks for an environment variable ANDROID_SDK. However, after having installed "Android Studio + QtCreator + Android Sdk" on both platform, I noticed that an environment variable named ANDROID_SDK_ROOT was added automatically (without my intervention). I propose that AddQtAndroidApk could use indifferently $ENV{ANDROID_SDK} or ENV{ANDROID_SDK_ROOT}. --- AddQtAndroidApk.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AddQtAndroidApk.cmake b/AddQtAndroidApk.cmake index f4b8279..4f4e05b 100644 --- a/AddQtAndroidApk.cmake +++ b/AddQtAndroidApk.cmake @@ -26,7 +26,10 @@ message(STATUS "Found Qt for Android: ${QT_ANDROID_QT_ROOT}") if(NOT QT_ANDROID_SDK_ROOT) set(QT_ANDROID_SDK_ROOT $ENV{ANDROID_SDK}) if(NOT QT_ANDROID_SDK_ROOT) - message(FATAL_ERROR "Could not find the Android SDK. Please set either the ANDROID_SDK environment variable, or the QT_ANDROID_SDK_ROOT CMake variable to the root directory of the Android SDK") + set(QT_ANDROID_SDK_ROOT $ENV{ANDROID_SDK_ROOT}) + if(NOT QT_ANDROID_SDK_ROOT) + message(FATAL_ERROR "Could not find the Android SDK. Please set either the ANDROID_SDK environment variable, or the QT_ANDROID_SDK_ROOT CMake variable to the root directory of the Android SDK") + endif() endif() endif() string(REPLACE "\\" "/" QT_ANDROID_SDK_ROOT ${QT_ANDROID_SDK_ROOT}) # androiddeployqt doesn't like backslashes in paths