summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPeter Seiderer <ps.report@gmx.net>2021-02-06 13:12:09 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-08 12:11:21 +0000
commit9d21728290a865139c0c4103ff886f61d4a2a0f5 (patch)
tree21303618a1e5bd9a6ee38efb0189aa98b1e9d69e /cmake
parentc67eaed8468c36629597aead9a768c9fe711ad85 (diff)
CMake/QtAutoDetect: fix failure with multiline toolchain file
The unquoted 'string(FIND ${toolchain_file_content} ...)' call fails for multiline content of the variable toolchain_file_content, so add quotes around, fixes: [...] CMake Error at cmake/QtAutoDetect.cmake:42 (string): string sub-command FIND requires 3 or 4 parameters. Call Stack (most recent call first): cmake/QtAutoDetect.cmake:311 (qt_auto_detect_android) CMakeLists.txt:19 (include) [...] -- Configuring incomplete, errors occurred! in case the given toolchain file starts with multiple lines in the first 80 characters, e.g. in the case of buildroot: # # Automatically generated file; DO NOT EDIT. # CMake toolchain file for Buildroot # [...] Task-number: QTBUG-90980 Change-Id: I8e038e08d83016e8253f2e83b2efb8f06034c6cd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 8aff901f70def69c2ac56754ef4146150e43bf8a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtAutoDetect.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtAutoDetect.cmake b/cmake/QtAutoDetect.cmake
index 4518078d8d..36761dba35 100644
--- a/cmake/QtAutoDetect.cmake
+++ b/cmake/QtAutoDetect.cmake
@@ -39,7 +39,7 @@ function(qt_auto_detect_android)
if(DEFINED CMAKE_TOOLCHAIN_FILE AND NOT DEFINED QT_AUTODETECT_ANDROID)
file(READ ${CMAKE_TOOLCHAIN_FILE} toolchain_file_content OFFSET 0 LIMIT 80)
- string(FIND ${toolchain_file_content} "The Android Open Source Project" find_result REVERSE)
+ string(FIND "${toolchain_file_content}" "The Android Open Source Project" find_result REVERSE)
if (NOT ${find_result} EQUAL -1)
set(android_detected TRUE)
else()