summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2024-03-06 16:34:40 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2024-03-20 09:57:09 +0100
commit5f242ab8041ed86448cc641f3e874847fa74a086 (patch)
tree6fd968953b1258974100ad2c1a8d498c7714ed72 /cmake
parent97ec9e974245574744cd00944c315eac98383434 (diff)
CMake: Adjust QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES for EP examples
Make sure to consider all qt_prefixes for adjusting QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES with locations where qml plugin config files might be present. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I5a7eec434635db1953871d735e2420c331ccee48 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 06fef6219e992489dae15e9851725e1675ff0bf6) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuildRepoExamplesHelpers.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/QtBuildRepoExamplesHelpers.cmake b/cmake/QtBuildRepoExamplesHelpers.cmake
index da8a44e4d0..fc130aa8c5 100644
--- a/cmake/QtBuildRepoExamplesHelpers.cmake
+++ b/cmake/QtBuildRepoExamplesHelpers.cmake
@@ -312,6 +312,22 @@ function(qt_internal_add_example_external_project subdir)
list(TRANSFORM module_paths APPEND "/${INSTALL_LIBDIR}/cmake/${QT_CMAKE_EXPORT_NAMESPACE}")
list(APPEND CMAKE_MODULE_PATH ${module_paths})
+ # Pass additional paths where qml plugin config files should be included by Qt6QmlPlugins.cmake.
+ # This is needed in prefix builds, where the cmake files are not installed yet.
+ set(glob_prefixes "${qt_prefixes}")
+ list(TRANSFORM glob_prefixes APPEND "/${INSTALL_LIBDIR}/cmake/${QT_CMAKE_EXPORT_NAMESPACE}Qml")
+
+ set(qml_plugin_cmake_config_file_glob_prefixes "")
+ foreach(glob_prefix IN LISTS glob_prefix)
+ if(EXISTS "${glob_prefix}")
+ list(APPEND qml_plugin_cmake_config_file_glob_prefixes "${glob_prefix}")
+ endif()
+ endforeach()
+
+ if(qml_plugin_cmake_config_file_glob_prefixes)
+ set(QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES ${qml_plugin_cmake_config_file_glob_prefixes})
+ endif()
+
# In multi-config mode by default we exclude building tools for configs other than the main one.
# Trying to build an example in a non-default config using the non-installed
# QtFooConfig.cmake files would error out saying moc is not found.
@@ -378,6 +394,7 @@ function(qt_internal_add_example_external_project subdir)
CMAKE_PREFIX_PATH:STRING
QT_BUILD_CMAKE_PREFIX_PATH:STRING
QT_ADDITIONAL_PACKAGES_PREFIX_PATH:STRING
+ QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES:STRING
CMAKE_FIND_ROOT_PATH:STRING
CMAKE_MODULE_PATH:STRING
BUILD_SHARED_LIBS:BOOL