aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlDeploySupport.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2022-09-07 17:01:49 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2022-11-16 14:31:42 +0100
commit3ec0254f1de2b797680ba2e7d02d7615ff275590 (patch)
tree3b3539df44ca47b4e4e81687697a99602b322fef /src/qml/Qt6QmlDeploySupport.cmake
parent38ab22e8a603cc5bc2e3f9ab47a17d063e89a44d (diff)
CMake: Add Linux support for qt_generate_deploy_qml_app_script
Make Linux a supported platform, and adjust the code to the changes in qtbase: use qt_generate_deploy_script, and pass build directory artifacts to qt_deploy_runtime_dependencies. Change-Id: I2211407217f3b32bb02c7f04407d019b43c26cdb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlDeploySupport.cmake')
-rw-r--r--src/qml/Qt6QmlDeploySupport.cmake34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/qml/Qt6QmlDeploySupport.cmake b/src/qml/Qt6QmlDeploySupport.cmake
index 8b142d14eb..8f7ffa6b55 100644
--- a/src/qml/Qt6QmlDeploySupport.cmake
+++ b/src/qml/Qt6QmlDeploySupport.cmake
@@ -188,11 +188,35 @@ function(_qt_internal_deploy_qml_imports_for_target)
file(INSTALL ${files} DESTINATION "${dest_plugin}" USE_SOURCE_PERMISSIONS)
get_filename_component(dest_plugin_abs "${dest_plugin}" ABSOLUTE)
- file(RELATIVE_PATH rel_path "${install_prefix_abs}" "${dest_plugin_abs}")
- foreach(file IN LISTS files)
- get_filename_component(filename "${file}" NAME)
- list(APPEND plugins_found "${rel_path}/${filename}")
- endforeach()
+ if(__QT_DEPLOY_TOOL STREQUAL "GRD")
+ # Use the full plugin path for deployment. This is necessary for file(GRD) to
+ # resolve the dependencies of the plugins.
+ list(APPEND plugins_found ${files})
+ else()
+ # Use relative paths for the plugins. If we used full paths here, macdeployqt would
+ # modify the RPATHS of plugins in the Qt installation.
+ file(RELATIVE_PATH rel_path "${install_prefix_abs}" "${dest_plugin_abs}")
+ foreach(file IN LISTS files)
+ get_filename_component(filename "${file}" NAME)
+ list(APPEND plugins_found "${rel_path}/${filename}")
+ endforeach()
+ endif()
+
+ if(__QT_DEPLOY_TOOL STREQUAL "GRD" AND __QT_DEPLOY_MUST_ADJUST_PLUGINS_RPATH)
+ # The RPATHs of the installed plugins do not match Qt's original lib directory.
+ # We must set the RPATH to point to QT_DEPLOY_LIBDIR.
+ _qt_internal_get_rpath_origin(rpath_origin)
+ foreach(file_path IN LISTS files)
+ get_filename_component(file_name ${file_path} NAME)
+ file(RELATIVE_PATH rel_lib_dir "${dest_plugin}"
+ "${QT_DEPLOY_PREFIX}/${QT_DEPLOY_LIB_DIR}"
+ )
+ _qt_internal_set_rpath(
+ FILE "${dest_plugin}/${file_name}"
+ NEW_RPATH "${rpath_origin}/${rel_lib_dir}"
+ )
+ endforeach()
+ endif()
if(arg_BUNDLE)
# Actual plugin binaries will be in PlugIns, but qmldir files