From 71157b9a00a8ac8f00a8b19ed50b179f458909a8 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 16 Jun 2022 19:39:22 +0200 Subject: [PATCH] CMake: Check that android qml import paths are not empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should check that native_qml_import_paths does not contain -NOTFOUND before trying to add the qml output directory as an import path. Amends b1fc45dbbfcca3ed0c489c01a5faa2f87ed09a35 Cherry picked from qtdeclarative's 1fb4a40b346b1767b3d0f472d101663c14e5d3b2 Task-number: QTBUG-102595 Change-Id: I884ecac3aa1bce77682bf74f22c892eadf310e07 Reviewed-by: Jörg Bornemann --- src/corelib/Qt6AndroidMacros.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 4f6eadbee57..28f973f53ea 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -184,7 +184,11 @@ function(qt6_android_generate_deployment_settings target) # Need to prepend the default qml module output directory to take precedence # over other qml import paths. By default QT_QML_OUTPUT_DIRECTORY is set to # ${CMAKE_BINARY_DIR}/android-qml for Android. - list(PREPEND qml_import_path "${QT_QML_OUTPUT_DIRECTORY}") + if(qml_import_path) + list(PREPEND qml_import_path "${QT_QML_OUTPUT_DIRECTORY}") + else() + set(qml_import_path "${QT_QML_OUTPUT_DIRECTORY}") + endif() endif() if (qml_import_path) set(_import_paths "")