diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 959581e2880..6d5e7175b89 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -3253,6 +3253,9 @@ function(qt_internal_walk_libs target out_var dict_name operation) continue() endif() + # Strip any directory scope tokens. + qt_internal_strip_target_directory_scope_token("${lib}" lib) + if(lib MATCHES "^\\$ + # Output: Threads::Threads + string(REGEX REPLACE "::@<.+>$" "" target "${target}") + set("${out_var}" "${target}" PARENT_SCOPE) +endfunction() + include(QtApp) # Compatibility macros that should be removed once all their usages are removed. diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 02c1905f8b4..6e365ec7347 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -35,6 +35,8 @@ macro(qt_collect_third_party_deps target) set(dep ${base_dep}) endif() + # Strip any directory scope tokens. + qt_internal_strip_target_directory_scope_token("${dep}" dep) if(TARGET ${dep}) list(FIND third_party_deps_seen ${dep} dep_seen)