From 9ea2f7f4b1192f3429aa2d3e278097008bc773bb Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 1 Jul 2022 12:42:31 +0200 Subject: CMake: Fix qml plugin prl files not to have hardcoded paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix 754512a64dffa20165e5b08b77e34b82c072f7f8 did not handle qml plugins, which meant that they would still have hardcoded paths and see warnings like the one below when generating the prl files CMake Warning (dev) at cmake/QtFinishPrlFile.cmake:103 (message): Could not determine relative path for library qml/QtQml/WorkerScript/libworkerscriptplugin_debug.a when generating prl file contents. An absolute path will be embedded, which will cause issues if the Qt installation is relocated. Handle qml plugins as well. Amends 754512a64dffa20165e5b08b77e34b82c072f7f8 Amends f4e998125981038e5e50dab8cc56039faaa0b750 Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-104708 Task-number: QTBUG-104396 Change-Id: Icfb1069d1cb0a39a35004b20e58ee6e386d14f3b Reviewed-by: Jörg Bornemann Reviewed-by: Alexey Edelev --- cmake/QtPrlHelpers.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmake/QtPrlHelpers.cmake') diff --git a/cmake/QtPrlHelpers.cmake b/cmake/QtPrlHelpers.cmake index 52f7854f16..298bc44c9b 100644 --- a/cmake/QtPrlHelpers.cmake +++ b/cmake/QtPrlHelpers.cmake @@ -145,6 +145,12 @@ ${prl_step1_content_libs} "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_PLUGINSDIR}") endif() + set(qt_qml_dirs "${QT_BUILD_DIR}/${INSTALL_QMLDIR}") + if(QT_WILL_INSTALL) + list(APPEND qt_qml_dirs + "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_QMLDIR}") + endif() + foreach(config ${configs}) # Output file for dependency tracking, and which will contain the final content. qt_path_join(prl_step2_path @@ -180,6 +186,7 @@ ${prl_step1_content_libs} "-DLINK_LIBRARY_FLAG=${link_library_flag}" "-DQT_LIB_DIRS=${qt_lib_dirs}" "-DQT_PLUGIN_DIRS=${qt_plugin_dirs}" + "-DQT_QML_DIRS=${qt_qml_dirs}" "-DIMPLICIT_LINK_DIRECTORIES=${implicit_link_directories}" -P "${QT_CMAKE_DIR}/QtFinishPrlFile.cmake" VERBATIM -- cgit v1.2.3