aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-09-08 15:13:26 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-10 16:50:24 +0000
commit121107c01d03107bd11b44724f461d3f455012b2 (patch)
tree822218f3f1abcb52901368a78105f8d0d1f25d05
parentf8fcc0be117569e202fd1478bd231cbc3461168d (diff)
CMake: Correctly process root paths for qmlimportscanner
The values in _qt_additional_packages_prefix_paths end in /lib/cmake, because they are prefix paths, not root paths. Adding ./qml to the end of those paths would never result in valid qml import path locations on disk. Use __qt_internal_prefix_paths_to_roots from the Qt6 package to strip away that suffix, before adding ./qml. This should fix the Conan multiple root paths case, as well as builds of ExternalProject examples during a prefix build of qtdeclarative. Note that the examples will still not run without setting the QML_IMPORT_PATH env variable to point to the qtdeclarative/qml build directory, or creating a qt.conf file in the example build dir that sets the qml import path to the qtdeclarative build dir. Amends 8bf916bfcbd5a05ec7370179317cd6d3a7dbd905 Fixes: QTBUG-106431 Task-number: QTBUG-96232 Task-number: QTBUG-102339 Change-Id: I6d3dd2b82634efc0faf756d884816dfb8a6ff4b6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 727151e0e03b0b91e1dc83c205a8608d5d5c236b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qml/Qt6QmlMacros.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 896d598fd9..4b4c9cc230 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -2585,7 +2585,9 @@ but this file does not exist. Possible reasons include:
# We have multiple installation prefixes: one per Qt repository (conan). Add those that have
# a "qml" subdirectory.
set(qml_import_paths)
- foreach(root IN ITEMS ${QT6_INSTALL_PREFIX} ${_qt_additional_packages_prefix_paths})
+ __qt_internal_prefix_paths_to_roots(
+ additional_root_paths "${_qt_additional_packages_prefix_paths}")
+ foreach(root IN ITEMS ${QT6_INSTALL_PREFIX} ${additional_root_paths})
set(candidate "${root}/${QT6_INSTALL_QML}")
if(IS_DIRECTORY "${candidate}")
list(APPEND qml_import_paths "${candidate}")