summarylogtreecommitdiffstats
path: root/0004-Fix-transitive-dependencies-of-static-libraries.patch
blob: f149c1cb73d553504fc7c4f18ea54ffbe8a4fa01 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
From f0176a1ae2e36b4ea89bda4a927bf387a4e20ead Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Thu, 5 Nov 2020 21:59:33 +0100
Subject: [PATCH 4/7] Fix transitive dependencies (of static libraries)

The dependencies of these libraries are not reliably picked up by their
corresponding find modules. This change allows adding the required
dependencies by setting certain variables, e.g. within the toolchain file.

Change-Id: I89da5ef519dd6dd3f86a94a01d3da7208a070bdb
---
 .../3rdparty/extra-cmake-modules/find-modules/FindGLIB2.cmake  | 2 +-
 cmake/FindMySQL.cmake                                          | 1 +
 cmake/FindWrapDBus1.cmake                                      | 3 ++-
 cmake/FindWrapOpenSSL.cmake                                    | 2 +-
 cmake/FindWrapSystemFreetype.cmake                             | 2 +-
 cmake/FindWrapSystemHarfbuzz.cmake                             | 2 +-
 cmake/FindWrapSystemPNG.cmake                                  | 2 +-
 src/plugins/sqldrivers/psql/CMakeLists.txt                     | 2 +-
 8 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindGLIB2.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindGLIB2.cmake
index 8f873c1b45..831ca8e624 100644
--- a/cmake/3rdparty/extra-cmake-modules/find-modules/FindGLIB2.cmake
+++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindGLIB2.cmake
@@ -95,7 +95,7 @@ if(GLIB2_FOUND AND NOT TARGET GLIB2::GLIB2)
   add_library(GLIB2::GLIB2 UNKNOWN IMPORTED)
   set_target_properties(GLIB2::GLIB2 PROPERTIES
                         IMPORTED_LOCATION "${GLIB2_LIBRARIES}"
-                        INTERFACE_LINK_LIBRARIES "${GTHREAD2_LIBRARIES}"
+                        INTERFACE_LINK_LIBRARIES "${GTHREAD2_LIBRARIES};${GLIB2_DEPENDENCIES}"
                         INTERFACE_INCLUDE_DIRECTORIES "${GLIB2_INCLUDE_DIRS}")
 endif()
 
diff --git a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake
index 54c94b8a2f..7575386338 100644
--- a/cmake/FindMySQL.cmake
+++ b/cmake/FindMySQL.cmake
@@ -38,6 +38,7 @@ if(MySQL_FOUND AND NOT TARGET MySQL::MySQL)
   add_library(MySQL::MySQL UNKNOWN IMPORTED)
   set_target_properties(MySQL::MySQL PROPERTIES
                         IMPORTED_LOCATION "${MySQL_LIBRARIES}"
+                        INTERFACE_LINK_LIBRARIES "${MYSQL_DEPENDENCIES}"
                         INTERFACE_INCLUDE_DIRECTORIES "${MySQL_INCLUDE_DIRS}")
 endif()
 
diff --git a/cmake/FindWrapDBus1.cmake b/cmake/FindWrapDBus1.cmake
index 4982e7c8ae..56d139c538 100644
--- a/cmake/FindWrapDBus1.cmake
+++ b/cmake/FindWrapDBus1.cmake
@@ -45,4 +45,5 @@ include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(WrapDBus1 REQUIRED_VARS
                                             DBus1_LIBRARY DBus1_INCLUDE_DIR WrapDBus1_FOUND
                                             VERSION_VAR DBus1_VERSION)
-set_property(TARGET dbus-1 PROPERTY IMPORTED_IMPLIB ${DBus1_LIBRARY})
\ No newline at end of file
+set_property(TARGET dbus-1 PROPERTY IMPORTED_IMPLIB ${DBus1_LIBRARY})
+set_property(TARGET dbus-1 PROPERTY INTERFACE_LINK_LIBRARIES "${DBUS1_DEPENDENCIES}")
diff --git a/cmake/FindWrapOpenSSL.cmake b/cmake/FindWrapOpenSSL.cmake
index 6e80862258..47bea72aad 100644
--- a/cmake/FindWrapOpenSSL.cmake
+++ b/cmake/FindWrapOpenSSL.cmake
@@ -14,7 +14,7 @@ if(OpenSSL_FOUND)
     set(WrapOpenSSL_FOUND ON)
 
     add_library(WrapOpenSSL::WrapOpenSSL INTERFACE IMPORTED)
-    target_link_libraries(WrapOpenSSL::WrapOpenSSL INTERFACE OpenSSL::SSL)
+    target_link_libraries(WrapOpenSSL::WrapOpenSSL INTERFACE OpenSSL::SSL ${OPENSSL_DEPENDENCIES})
 endif()
 
 include(FindPackageHandleStandardArgs)
diff --git a/cmake/FindWrapSystemFreetype.cmake b/cmake/FindWrapSystemFreetype.cmake
index 2cf6caca19..23dc161e4c 100644
--- a/cmake/FindWrapSystemFreetype.cmake
+++ b/cmake/FindWrapSystemFreetype.cmake
@@ -44,7 +44,7 @@ find_package_handle_standard_args(WrapSystemFreetype
 if(WrapSystemFreetype_FOUND)
     add_library(WrapSystemFreetype::WrapSystemFreetype INTERFACE IMPORTED)
     target_link_libraries(WrapSystemFreetype::WrapSystemFreetype
-                          INTERFACE "${__freetype_target_name}")
+                          INTERFACE "${__freetype_target_name}" ${FREETYPE_DEPENDENCIES})
 endif()
 unset(__freetype_target_name)
 unset(__freetype_found)
diff --git a/cmake/FindWrapSystemHarfbuzz.cmake b/cmake/FindWrapSystemHarfbuzz.cmake
index 3cb44aa766..9dc741b2be 100644
--- a/cmake/FindWrapSystemHarfbuzz.cmake
+++ b/cmake/FindWrapSystemHarfbuzz.cmake
@@ -54,7 +54,7 @@ find_package_handle_standard_args(WrapSystemHarfbuzz
 if(WrapSystemHarfbuzz_FOUND)
     add_library(WrapSystemHarfbuzz::WrapSystemHarfbuzz INTERFACE IMPORTED)
     target_link_libraries(WrapSystemHarfbuzz::WrapSystemHarfbuzz
-                          INTERFACE "${__harfbuzz_target_name}")
+                          INTERFACE "${__harfbuzz_target_name}" ${HARFBUZZ_DEPENDENCIES})
 endif()
 unset(__harfbuzz_target_name)
 unset(__harfbuzz_found)
diff --git a/cmake/FindWrapSystemPNG.cmake b/cmake/FindWrapSystemPNG.cmake
index 372a064ff4..a363bfd31b 100644
--- a/cmake/FindWrapSystemPNG.cmake
+++ b/cmake/FindWrapSystemPNG.cmake
@@ -33,7 +33,7 @@ find_package_handle_standard_args(WrapSystemPNG
 if(WrapSystemPNG_FOUND)
     add_library(WrapSystemPNG::WrapSystemPNG INTERFACE IMPORTED)
     target_link_libraries(WrapSystemPNG::WrapSystemPNG
-                          INTERFACE "${__png_target_name}")
+                          INTERFACE "${__png_target_name}" ${LIBPNG_DEPENDENCIES})
 endif()
 unset(__png_target_name)
 unset(__png_found)
diff --git a/src/plugins/sqldrivers/psql/CMakeLists.txt b/src/plugins/sqldrivers/psql/CMakeLists.txt
index 62e9619d16..939163bde7 100644
--- a/src/plugins/sqldrivers/psql/CMakeLists.txt
+++ b/src/plugins/sqldrivers/psql/CMakeLists.txt
@@ -19,7 +19,7 @@ qt_internal_add_plugin(QPSQLDriverPlugin
         QT_NO_CAST_FROM_ASCII
         QT_NO_CAST_TO_ASCII
     PUBLIC_LIBRARIES
-        PostgreSQL::PostgreSQL
+        PostgreSQL::PostgreSQL ${POSTGRESQL_DEPENDENCIES}
         Qt::Core
         Qt::CorePrivate
         Qt::SqlPrivate
-- 
2.29.2