diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-07-01 12:42:31 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-07-02 00:11:12 +0200 |
commit | 9ea2f7f4b1192f3429aa2d3e278097008bc773bb (patch) | |
tree | a5ec8c543004461473b2784b7c83a9ae0b02ac4e /cmake/QtFinishPrlFile.cmake | |
parent | d59628881e0b35d10fa4cf7ba7b892b07cc18106 (diff) |
CMake: Fix qml plugin prl files not to have hardcoded paths
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 <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake/QtFinishPrlFile.cmake')
-rw-r--r-- | cmake/QtFinishPrlFile.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtFinishPrlFile.cmake b/cmake/QtFinishPrlFile.cmake index 9c93bd49a1..32169e418c 100644 --- a/cmake/QtFinishPrlFile.cmake +++ b/cmake/QtFinishPrlFile.cmake @@ -96,6 +96,10 @@ foreach(line ${lines}) "${target_library_path}" "${QT_PLUGIN_DIRS}" lib_is_a_qt_plugin relative_lib) endif() if(NOT lib_is_a_qt_module AND NOT lib_is_a_qt_plugin) + qt_internal_path_is_relative_to_qt_lib_path( + "${target_library_path}" "${QT_QML_DIRS}" lib_is_a_qt_qml_plugin relative_lib) + endif() + if(NOT lib_is_a_qt_module AND NOT lib_is_a_qt_plugin AND NOT lib_is_a_qt_qml_plugin) message(AUTHOR_WARNING "Could not determine relative path for library ${target_library_path} when " "generating prl file contents. An absolute path will be embedded, which " @@ -107,6 +111,8 @@ foreach(line ${lines}) set(qmake_lib_path_prefix "$$[QT_INSTALL_LIBS]") elseif(lib_is_a_qt_plugin) set(qmake_lib_path_prefix "$$[QT_INSTALL_PLUGINS]") + elseif(lib_is_a_qt_qml_plugin) + set(qmake_lib_path_prefix "$$[QT_INSTALL_QML]") endif() qt_strip_library_version_suffix(relative_lib "${relative_lib}") list(APPEND libs_to_prepend "${qmake_lib_path_prefix}/${relative_lib}") |