Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / qt-5 / 5.15 / qtbase.patch.d / 0005-qtbase-cmake.patch
blob19646df1666ffbc44efcc806d705f2a46dc06e1f
1 From 7871fbcefc7596a458cec005edafd9d4962baea3 Mon Sep 17 00:00:00 2001
2 From: Thomas Tuegel <ttuegel@mailbox.org>
3 Date: Tue, 17 Sep 2019 05:34:28 -0500
4 Subject: [PATCH 05/11] qtbase-cmake
6 ---
7 mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 2 +-
8 mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in | 4 ++--
9 src/corelib/Qt5CoreConfigExtras.cmake.in | 10 +++++-----
10 src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in | 2 +-
11 .../Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in | 2 +-
12 src/dbus/Qt5DBusConfigExtras.cmake.in | 12 ++----------
13 src/gui/Qt5GuiConfigExtras.cmake.in | 6 +++---
14 src/widgets/Qt5WidgetsConfigExtras.cmake.in | 2 +-
15 8 files changed, 16 insertions(+), 24 deletions(-)
17 diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
18 index b6c3ab8609..edb6a89316 100644
19 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
20 +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
21 @@ -513,7 +513,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
22 IsDebugAndRelease)
23 set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
25 - set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
26 + set(imported_location \"${PLUGIN_LOCATION}\")
27 _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
28 set_target_properties(Qt5::${Plugin} PROPERTIES
29 \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
30 diff --git a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
31 index b550a52c60..dbd3243885 100644
32 --- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
33 +++ b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
34 @@ -53,10 +53,10 @@ set_property(TARGET Qt5::$$CMAKE_PLUGIN_NAME PROPERTY INTERFACE_SOURCES
35 !!ENDIF
37 !!IF !isEmpty(CMAKE_RELEASE_TYPE)
38 -_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
39 +_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
40 !!ENDIF
41 !!IF !isEmpty(CMAKE_DEBUG_TYPE)
42 -_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
43 +_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
44 !!ENDIF
46 list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
47 diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
48 index 4c1c3a612b..bb8ab08143 100644
49 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in
50 +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
51 @@ -6,7 +6,7 @@ if (NOT TARGET Qt5::qmake)
52 add_executable(Qt5::qmake IMPORTED)
54 !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
55 - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
56 + set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
57 !!ELSE
58 set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
59 !!ENDIF
60 @@ -21,7 +21,7 @@ if (NOT TARGET Qt5::moc)
61 add_executable(Qt5::moc IMPORTED)
63 !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
64 - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
65 + set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
66 !!ELSE
67 set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
68 !!ENDIF
69 @@ -38,7 +38,7 @@ if (NOT TARGET Qt5::rcc)
70 add_executable(Qt5::rcc IMPORTED)
72 !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
73 - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
74 + set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
75 !!ELSE
76 set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
77 !!ENDIF
78 @@ -121,7 +121,7 @@ if (NOT TARGET Qt5::WinMain)
79 !!IF !isEmpty(CMAKE_RELEASE_TYPE)
80 set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
81 !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
82 - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
83 + set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
84 !!ELSE
85 set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
86 !!ENDIF
87 @@ -135,7 +135,7 @@ if (NOT TARGET Qt5::WinMain)
88 set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
90 !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
91 - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
92 + set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
93 !!ELSE
94 set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
95 !!ENDIF
96 diff --git a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
97 index c357237d0e..6f0c75de3c 100644
98 --- a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
99 +++ b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
100 @@ -1,6 +1,6 @@
102 !!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE)
103 -set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
104 +set(_qt5_corelib_extra_includes \"$$NIX_OUTPUT_DEV/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
105 !!ELSE
106 set(_qt5_corelib_extra_includes \"$${CMAKE_HOST_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
107 !!ENDIF
108 diff --git a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
109 index 706304cf34..546420f6ad 100644
110 --- a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
111 +++ b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
112 @@ -1,6 +1,6 @@
114 !!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE)
115 -set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
116 +set(_qt5_corelib_extra_includes \"$$NIX_OUTPUT_DEV/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
117 !!ELSE
118 set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
119 !!ENDIF
120 diff --git a/src/dbus/Qt5DBusConfigExtras.cmake.in b/src/dbus/Qt5DBusConfigExtras.cmake.in
121 index a814678f7b..b13b964ec8 100644
122 --- a/src/dbus/Qt5DBusConfigExtras.cmake.in
123 +++ b/src/dbus/Qt5DBusConfigExtras.cmake.in
124 @@ -2,11 +2,7 @@
125 if (NOT TARGET Qt5::qdbuscpp2xml)
126 add_executable(Qt5::qdbuscpp2xml IMPORTED)
128 -!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
129 - set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
130 -!!ELSE
131 - set(imported_location \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
132 -!!ENDIF
133 + set(imported_location \"$$NIX_OUTPUT_DEV/bin/qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
134 _qt5_DBus_check_file_exists(${imported_location})
136 set_target_properties(Qt5::qdbuscpp2xml PROPERTIES
137 @@ -17,11 +13,7 @@ endif()
138 if (NOT TARGET Qt5::qdbusxml2cpp)
139 add_executable(Qt5::qdbusxml2cpp IMPORTED)
141 -!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
142 - set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
143 -!!ELSE
144 - set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
145 -!!ENDIF
146 + set(imported_location \"$$NIX_OUTPUT_DEV/bin/qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
147 _qt5_DBus_check_file_exists(${imported_location})
149 set_target_properties(Qt5::qdbusxml2cpp PROPERTIES
150 diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
151 index 84dbbfebd4..8ad0720c5c 100644
152 --- a/src/gui/Qt5GuiConfigExtras.cmake.in
153 +++ b/src/gui/Qt5GuiConfigExtras.cmake.in
154 @@ -2,7 +2,7 @@
155 !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
157 !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
158 -set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\")
159 +set(Qt5Gui_EGL_INCLUDE_DIRS \"$$NIX_OUTPUT_DEV/$$CMAKE_INCLUDE_DIR/QtANGLE\")
160 !!ELSE
161 set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\")
162 !!ENDIF
163 @@ -17,13 +17,13 @@ macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATIO
164 set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
166 !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
167 - set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
168 + set(imported_location \"$$NIX_OUTPUT_OUT/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
169 !!ELSE
170 set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
171 !!ENDIF
173 !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
174 - set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
175 + set(imported_implib \"$$NIX_OUTPUT_OUT/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
176 !!ELSE
177 set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
178 !!ENDIF
179 diff --git a/src/widgets/Qt5WidgetsConfigExtras.cmake.in b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
180 index 83d8004a08..ca0b8e4bfb 100644
181 --- a/src/widgets/Qt5WidgetsConfigExtras.cmake.in
182 +++ b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
183 @@ -3,7 +3,7 @@ if (NOT TARGET Qt5::uic)
184 add_executable(Qt5::uic IMPORTED)
186 !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
187 - set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
188 + set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
189 !!ELSE
190 set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
191 !!ENDIF
193 2.25.4