From 170a8693d3b77587792c99605413666ad9b3ce74 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 15 Jan 2021 15:48:59 +0100 Subject: QtEntryPoint: Fix linking Release against RelWithDebInfo with MSVC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To be able to link a Release user project against a RelWithDebInfo Qt we set several IMPORTED_*_RELEASE properties in the *AdditionalTargetInfo.cmake file of each Qt module. The EntryPoint module however is a bit special as it is an INTERFACE_LIBRARY linking publicly against a static library (EntryPointimplementation). Its *AdditionalTargetInfo.cmake file was almost empty, because qt_internal_export_additional_targets_file was called before EntryPointImplementation was set up. Also, qt_internal_add_module, which calls qt_internal_export_additional_targets_file, does not know that we want to export the EntryPointImplementation target. We fix this by telling qt_internal_add_module(EntryPoint) to not generate the *AdditionalTargetInfo.cmake file and call qt_internal_export_additional_targets_file later to take the targets EntryPoint and EntryPointImplementation into consideration. qt_internal_add_module learned the option NO_ADDITIONAL_TARGET_INFO to turn off the generation of *AdditionalTargetInfo.cmake files. Fixes: QTBUG-90039 Change-Id: I68ec7125b538a57567035e7adb8dac3b213f95e6 Reviewed-by: Tor Arne Vestbø (cherry picked from commit b0add5bf2f56c2afc8bdf27ccbb153414617250b) Reviewed-by: Qt Cherry-pick Bot --- src/entrypoint/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/entrypoint/CMakeLists.txt') diff --git a/src/entrypoint/CMakeLists.txt b/src/entrypoint/CMakeLists.txt index ba35a173d7..1a145746ac 100644 --- a/src/entrypoint/CMakeLists.txt +++ b/src/entrypoint/CMakeLists.txt @@ -17,6 +17,7 @@ qt_internal_add_module(EntryPoint NO_SYNC_QT NO_MODULE_HEADERS NO_PRIVATE_MODULE + NO_ADDITIONAL_TARGET_INFO ) # We don't need any include paths or default module defines @@ -102,6 +103,13 @@ QT.entrypoint_implementation.module_config = staticlib v2 internal_module set(export_name "${INSTALL_CMAKE_NAMESPACE}EntryPointTargets") qt_install(TARGETS EntryPointImplementation EXPORT ${export_name}) qt_generate_prl_file(EntryPointImplementation "${INSTALL_LIBDIR}") + + set(export_name_prefix "${INSTALL_CMAKE_NAMESPACE}EntryPoint") + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${export_name_prefix}) + qt_internal_export_additional_targets_file( + TARGETS EntryPoint EntryPointImplementation + EXPORT_NAME_PREFIX ${export_name_prefix} + CONFIG_INSTALL_DIR "${config_install_dir}") endif() # special case end -- cgit v1.2.3