CMake: Generate *AdditionalTargetInfo.cmake for tools

This ensures that we have the configuration-independent IMPORTED_*
properties set on tools.

Fixes: QTBUG-86893
Change-Id: I2b772c21341e6e4631379d4a5a99580ec96909ed
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2020-09-25 12:18:58 +02:00
parent 347d2163b2
commit 3d54f47cea
3 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,7 @@ if (NOT QT_NO_CREATE_TARGETS)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@AdditionalTargetInfo.cmake")
if(NOT QT_NO_CREATE_VERSIONLESS_TARGETS)
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@VersionlessTargets.cmake")
endif()

View File

@ -350,7 +350,10 @@ endif()
if(target_type STREQUAL "INTERFACE_LIBRARY")
continue()
endif()
set(full_target ${QT_CMAKE_EXPORT_NAMESPACE}::${target})
set(full_target ${target})
if(NOT full_target MATCHES "^${QT_CMAKE_EXPORT_NAMESPACE}::")
string(PREPEND full_target "${QT_CMAKE_EXPORT_NAMESPACE}::")
endif()
set(properties_retrieved TRUE)
if(NOT "${uc_release_cfg}" STREQUAL "")
string(APPEND content "get_target_property(_qt_imported_location ${full_target} IMPORTED_LOCATION_${uc_release_cfg})\n")

View File

@ -302,6 +302,10 @@ endif()
NAMESPACE "${QT_CMAKE_EXPORT_NAMESPACE}::"
DESTINATION "${config_install_dir}")
qt_internal_export_additional_targets_file(
TARGETS ${tool_targets}
EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target}
CONFIG_INSTALL_DIR "${config_install_dir}")
# Create versionless targets file.
configure_file(