diff options
author | Sami Shalayel <sami.shalayel@qt.io> | 2024-04-23 16:31:58 +0200 |
---|---|---|
committer | Sami Shalayel <sami.shalayel@qt.io> | 2024-04-24 16:49:06 +0200 |
commit | 5fdd8793c2adc7c2c93f5d02ef33044dc784afa4 (patch) | |
tree | b449275e0b1f5ab005c2daf7e9f344ec13420f1f /src | |
parent | 73a2843dadb5819090e98259806ce4c1a8057f0a (diff) |
cmake: fix .qmlls.ini generation for dotted uris
QML Modules with dotted URIs actually should not have .qmlls.ini point
the QML modules build folder, but to the build folder from which qmlls
can actually find the QML module.
For example, a QML module called Dotted.Uri.Hello.World should have the
build directory `<buildfolder>/` instead of
`<buildfolder>/Dotted/Uri/Hello/World`.
Add tests for that, and pick back to 6.7 where the feature was
introduced.
Pick-to: 6.7
Fixes: QTBUG-124521
Change-Id: I95cf8e0d5894c5ad2c6f3117224d0a1a76cf531f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 9d79bae9cd..5352f896f6 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -743,7 +743,11 @@ Check https://doc.qt.io/qt-6/qt-cmake-policy-qtp0001.html for policy details." else() set(output_folder "${CMAKE_CURRENT_BINARY_DIR}") endif() - get_filename_component(build_folder "${output_folder}" DIRECTORY) + string(REPLACE "." ";" uri_bits "${arg_URI}") + set(build_folder "${output_folder}") + foreach(bit IN LISTS uri_bits) + get_filename_component(build_folder "${build_folder}" DIRECTORY) + endforeach() get_directory_property(_qmlls_ini_build_folders _qmlls_ini_build_folders) list(APPEND _qmlls_ini_build_folders "${build_folder}") set_directory_properties(PROPERTIES _qmlls_ini_build_folders "${_qmlls_ini_build_folders}") |