blob: 965dade1c1339b8fbd5127d6dc972595ebca7c12 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
https://bugs.gentoo.org/928299
https://bugreports.qt.io/browse/QTBUG-124135
https://codereview.qt-project.org/c/qt/qtbase/+/553372
From: Alexey Edelev <alexey.edelev@qt.io>
Date: Fri, 05 Apr 2024 14:50:37 +0200
Subject: [PATCH] Prefer the versioned targets over the namespaceless one when collecting deps
Change the way we collect dependencies in __qt_internal_walk_libs.
Prefer the versioned Qt targets over the namespaceless. This fixes the
generating of the pkg-config configs.
Pick-to: 6.5 6.6 6.7
Task-number: QTBUG-124135
Change-Id: I660376e122a99b5bc0874f2bc6ccd4d80c9ad453
--- a/cmake/QtPublicWalkLibsHelpers.cmake
+++ b/cmake/QtPublicWalkLibsHelpers.cmake
@@ -184,13 +184,13 @@
if(lib_target MATCHES "^::@")
continue()
elseif(TARGET ${lib_target})
- if ("${lib_target}" MATCHES "^Qt::(.*)")
- # If both, Qt::Foo and Foo targets exist, prefer the target name without
+ if(NOT "${lib_target}" MATCHES "^(Qt|${QT_CMAKE_EXPORT_NAMESPACE})::.+")
+ # If both, Qt::Foo and Foo targets exist, prefer the target name with versioned
# namespace. Which one is preferred doesn't really matter. This code exists to
# avoid ending up with both, Qt::Foo and Foo in our dependencies.
- set(namespaceless_lib_target "${CMAKE_MATCH_1}")
- if(TARGET "${namespaceless_lib_target}")
- set(lib_target ${namespaceless_lib_target})
+ set(versioned_qt_target "${QT_CMAKE_EXPORT_NAMESPACE}::${lib_target}")
+ if(TARGET "${versioned_qt_target}")
+ set(lib_target ${versioned_qt_target})
endif()
endif()
get_target_property(lib_target_type ${lib_target} TYPE)
|