mirror of https://github.com/qt/qtbase.git
CMake: Fix qml plugin prl files not to have hardcoded paths
The previous fix754512a64d
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. Amends754512a64d
Amendsf4e9981259
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>
This commit is contained in:
parent
d59628881e
commit
9ea2f7f4b1
|
@ -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}")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue