diff options
Diffstat (limited to 'cmake/QtPrlHelpers.cmake')
-rw-r--r-- | cmake/QtPrlHelpers.cmake | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/cmake/QtPrlHelpers.cmake b/cmake/QtPrlHelpers.cmake index a74a2cf6fd..45bfaedcdf 100644 --- a/cmake/QtPrlHelpers.cmake +++ b/cmake/QtPrlHelpers.cmake @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + # Collects the library dependencies of a target. # As well as rcc object file dependencies. # This takes into account transitive usage requirements. @@ -105,8 +108,8 @@ function(qt_generate_prl_file target install_dir) # whose names we know, and can be used in add_custom_command. set(prl_step1_content "RCC_OBJECTS = ${rcc_objects} -QMAKE_PRL_BUILD_DIR = ${CMAKE_CURRENT_BINARY_DIR} QMAKE_PRL_TARGET = $<TARGET_LINKER_FILE_NAME:${target}> +QMAKE_PRL_TARGET_PATH_FOR_CMAKE = $<TARGET_LINKER_FILE:${target}> QMAKE_PRL_CONFIG = ${prl_config} QMAKE_PRL_VERSION = ${PROJECT_VERSION} ${prl_step1_content_libs} @@ -138,6 +141,18 @@ ${prl_step1_content_libs} "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_LIBDIR}") endif() + set(qt_plugin_dirs "${QT_BUILD_DIR}/${INSTALL_PLUGINSDIR}") + if(QT_WILL_INSTALL) + list(APPEND qt_plugin_dirs + "${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 @@ -153,8 +168,10 @@ ${prl_step1_content_libs} "${prl_meta_info_name_prefix}${config}${prl_meta_info_name_suffix}") if(MSVC) set(link_library_flag "-l") + file(TO_CMAKE_PATH "$ENV{LIB};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}" implicit_link_directories) else() set(link_library_flag ${CMAKE_LINK_LIBRARY_FLAG}) + set(implicit_link_directories ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}) endif() add_custom_command( OUTPUT "${prl_step2_path}" @@ -170,7 +187,9 @@ ${prl_step1_content_libs} "-DLIBRARY_SUFFIXES=${library_suffixes}" "-DLINK_LIBRARY_FLAG=${link_library_flag}" "-DQT_LIB_DIRS=${qt_lib_dirs}" - "-DIMPLICIT_LINK_DIRECTORIES=${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}" + "-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 COMMENT "Generating prl file for target ${target}" |