From 840f5c17602bc46871cebef10a48e32ee617c116 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 18 Mar 2024 18:51:51 +0100 Subject: [PATCH] Set the _qt_ module properties for interface targets The module properties starting with _qt can be set on interface targets. We should set them to handle _qt_config_module_name property for Private targets correctly. Otherwise private imported modules do not land in .pri files as dependencies. Amends 173164cd477211e574c0d04abef51aa0f4c3f78d Fixes: QTBUG-123410 Change-Id: I14866eb407e6ddcbd625f5546cba22ccc7b6a297 Reviewed-by: Alexandru Croitor --- cmake/QtPublicCMakeHelpers.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/QtPublicCMakeHelpers.cmake b/cmake/QtPublicCMakeHelpers.cmake index 02a67582ea2..b8a3e6eef95 100644 --- a/cmake/QtPublicCMakeHelpers.cmake +++ b/cmake/QtPublicCMakeHelpers.cmake @@ -356,6 +356,9 @@ function(_qt_internal_create_versionless_targets targets install_namespace) QT_QMAKE_PRIVATE_CONFIG QT_QMAKE_PUBLIC_CONFIG QT_QMAKE_PUBLIC_QT_CONFIG + ) + + set(known_qt_exported_properties_interface_allowed _qt_config_module_name _qt_is_public_module _qt_module_has_headers @@ -429,5 +432,14 @@ function(_qt_internal_create_versionless_targets targets install_namespace) INTERFACE_${property} "${interface_property_value}") endif() endforeach() + + foreach(property IN LISTS known_qt_exported_properties_interface_allowed) + get_target_property(exported_property_value + ${install_namespace}::${target} ${property}) + if(exported_property_value) + set_property(TARGET Qt::${target} APPEND PROPERTY + ${property} "${exported_property_value}") + endif() + endforeach() endforeach() endfunction()