cmake: Handle exported namespace when computing deps

We need to handle the possibility of versioned dep (Qt6::Foo).

Change-Id: I66797dbc59f00500892958e9c99c4555cddcb980
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-11-10 15:15:09 +01:00
parent da7609e7d0
commit a299f337c5

View File

@ -129,8 +129,8 @@ function(qt_internal_create_module_depends_file target)
set(all_depends ${depends} ${public_depends})
foreach (dep ${all_depends})
# Normalize module by stripping leading "Qt::" and trailing "Private"
if (dep MATCHES "Qt::([A-Za-z0-9]+)")
set(dep "${CMAKE_MATCH_1}")
if (dep MATCHES "(Qt|${QT_CMAKE_EXPORT_NAMESPACE})::([A-Za-z0-9]+)")
set(dep "${CMAKE_MATCH_2}")
if (TARGET Qt::${dep})
get_target_property(dep_type Qt::${dep} TYPE)
if (NOT dep_type STREQUAL "INTERFACE_LIBRARY")