diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-09-08 15:13:26 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-09-09 13:09:09 +0000 |
commit | 5b35a32eccf8464edd3de602b3b40073ff0f2021 (patch) | |
tree | c797227e8576578e63c2048652a64bcc613311f1 | |
parent | 6949fec1cc0299a84815a3f070867eb626e6f19b (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.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 79d13bc6f8..dd76f8496b 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -2407,7 +2407,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}") |