Debian Codegraph @

usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf

raw
1 CONFIG *= thread
2
3 #handle defines
4 win32 {
5 contains(QT_CONFIG, shared) {
6 # this variable is read by qmake in qmake/generators/win32/msvc_vcproj.cpp
7 # function VcprojGenerator::initDeploymentTool()
8 QMAKE_DLL_PATHS += $$[QT_INSTALL_BINS/get]
9 }
10 }
11 CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG
12 contains(QT_CONFIG, force_asserts):DEFINES += QT_FORCE_ASSERTS
13 no_keywords:DEFINES += QT_NO_KEYWORDS
14 plugin { #Qt plugins
15 static:DEFINES += QT_STATICPLUGIN
16 DEFINES += QT_PLUGIN
17 }
18
19 qtestlib {
20 warning("CONFIG+=qtestlib is deprecated. Use QT+=testlib instead.")
21 QT += testlib
22 }
23 qdbus {
24 warning("CONFIG+=qdbus is deprecated. Use QT+=dbus instead.")
25 QT += dbus
26 }
27 help {
28 warning("CONFIG+=help is deprecated. Use QT+=help instead.")
29 QT += help-private # sic!
30 }
31 designer {
32 warning("CONFIG+=designer is deprecated. Use QT+=designer instead.")
33 QT += designer
34 }
35 uitools {
36 warning("CONFIG+=uitools is deprecated. Use QT+=uitools instead.")
37 QT += uitools
38 }
39 qaxcontainer {
40 warning("CONFIG+=qaxcontainer is deprecated. Use QT+=axcontainer instead.")
41 QT += axcontainer
42 }
43 qaxserver {
44 warning("CONFIG+=qaxserver is deprecated. Use QT+=axserver instead.")
45 QT += axserver
46 }
47
48 # target variable, flag source variable
49 defineTest(qtProcessModuleFlags) {
50 for(flag, $$2) {
51 contains(flag, ^-.*): \
52 $$1 -= $$replace(flag, ^-, )
53 else: \
54 $$1 += $$flag
55 }
56 export($$1)
57 }
58
59 unset(using_privates)
60 var_sfx =
61 for(ever) {
62 # qmake variables cannot contain dashes, so normalize the names first
63 CLEAN_QT$$var_sfx = $$replace(QT$$var_sfx, -private$, _private)
64 # Topological resolution of modules based on their QT.<module>.depends variable
65 FULL_QT$$var_sfx = $$resolve_depends(CLEAN_QT$$var_sfx, "QT.")
66 # Finally actually add the modules
67 unset(BAD_QT)
68 for(QTLIB, FULL_QT$$var_sfx) {
69 MODULE_NAME = $$eval(QT.$${QTLIB}.name)
70 MODULE_MODULE = $$eval(QT.$${QTLIB}.module)
71 MODULE_INCLUDES = $$eval(QT.$${QTLIB}.includes)
72 MODULE_LIBS = $$eval(QT.$${QTLIB}.libs)
73 MODULE_FRAMEWORKS = $$eval(QT.$${QTLIB}.frameworks)
74 MODULE_CONFIG = $$eval(QT.$${QTLIB}.module_config)
75
76 isEmpty(MODULE_NAME) {
77 BAD_QT += $$QTLIB
78 next()
79 }
80
81 contains(MODULE_CONFIG, internal_module): \
82 using_privates = true
83 contains(MODULE_CONFIG, ltcg): \
84 CONFIG += link_ltcg
85
86 qtProcessModuleFlags(CONFIG, QT.$${QTLIB}.CONFIG)
87 qtProcessModuleFlags(DEFINES, QT.$${QTLIB}.DEFINES)
88
89 MODULE_INCLUDES -= $$QMAKE_DEFAULT_INCDIRS
90 MODULE_LIBS_ADD = $$MODULE_LIBS
91 MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS
92
93 !contains(MODULE_CONFIG, v2) {
94 # Backwards compatibility with pre-5.6 module .pri files
95
96 contains(MODULE_CONFIG, lib_bundle) {
97 MODULE_FRAMEWORKS = $$MODULE_LIBS
98 inc = $$MODULE_LIBS/$${MODULE_NAME}.framework/Headers
99 MODULE_INCLUDES = $$inc
100 contains(MODULE_CONFIG, internal_module): \
101 MODULE_INCLUDES += \
102 $$inc/$$eval(QT.$${QTLIB}.VERSION) \
103 $$inc/$$eval(QT.$${QTLIB}.VERSION)/$$MODULE_NAME
104 } else {
105 # Re-insert the major version in the library name (cf qt5LibraryTarget above)
106 MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
107 }
108
109 # Only link to this module if a libs directory is set, else this is just a module
110 # to give access to sources or include files, and not for linking.
111 !isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link): \
112 MODULE_MODULE = $${MODULE_NAME}$${QT_LIBINFIX}
113 }
114
115 # Frameworks shouldn't need include paths, but much code does not use
116 # module-qualified #includes, so by default we add paths which point
117 # directly into the frameworks. Private modules have somewhat convoluted
118 # header paths, so adding them is necessary in every case.
119 !if(contains(MODULE_CONFIG, lib_bundle):qt_no_framework_direct_includes) \
120 |contains(MODULE_CONFIG, internal_module): \
121 INCLUDEPATH *= $$MODULE_INCLUDES
122 QMAKE_FRAMEWORKPATH *= $$MODULE_FRAMEWORKS
123 !isEmpty(MODULE_MODULE) {
124 contains(MODULE_CONFIG, lib_bundle) {
125 LIBS$$var_sfx += -framework $$MODULE_MODULE
126 } else {
127 !isEmpty(MODULE_LIBS_ADD): \
128 LIBS$$var_sfx += -L$$MODULE_LIBS_ADD
129
130 lib = $$MODULE_MODULE$$qtPlatformTargetSuffix()
131 LIBS$$var_sfx += -l$$lib
132
133 contains(MODULE_CONFIG, staticlib): \
134 PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
135
136 !isEmpty(QMAKE_LSB) {
137 !isEmpty(MODULE_LIBS_ADD): \
138 QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD
139 QMAKE_LFLAGS *= --lsb-shared-libs=$$lib
140 QMAKE_LIBDIR *= /opt/lsb/lib
141 }
142 }
143 }
144 # Add capabilities as defined by modules used in the project
145 winrt {
146 MODULE_WINRT_CAPABILITIES = $$eval(QT.$${QTLIB}.winrt_capabilities)
147 !isEmpty(MODULE_WINRT_CAPABILITIES): \
148 WINRT_MANIFEST.capabilities_default += $$MODULE_WINRT_CAPABILITIES
149 MODULE_WINRT_CAPABILITIES_DEVICE = $$eval(QT.$${QTLIB}.winrt_capabilities_device)
150 !isEmpty(MODULE_WINRT_CAPABILITIES_DEVICE): \
151 WINRT_MANIFEST.capabilities_device_default += $$MODULE_WINRT_CAPABILITIES_DEVICE
152 }
153 }
154 !isEmpty(BAD_QT):error("Unknown module(s) in QT$$var_sfx: $$replace(BAD_QT, _private$, -private)")
155
156 !isEmpty(var_sfx): break()
157 var_sfx = _PRIVATE
158 }
159 !isEmpty(using_privates):!no_private_qt_headers_warning:!build_pass {
160 message("This project is using private headers and will therefore be tied to this specific Qt module build version.")
161 message("Running this project against other versions of the Qt modules may crash at any arbitrary point.")
162 message("This is not a bug, but a result of using Qt internals. You have been warned!")
163 }
164
165 qt_module_deps = $$CLEAN_QT $$CLEAN_QT_PRIVATE
166 qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
167
168 !no_qt_rpath:!static:contains(QT_CONFIG, rpath):!contains(QT_CONFIG, static):\
169 contains(qt_module_deps, core) {
170 relative_qt_rpath:!isEmpty(QMAKE_REL_RPATH_BASE):contains(INSTALLS, target):\
171 isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) {
172 # NOT the /dev property, as INSTALLS use host paths
173 QMAKE_RPATHDIR += $$relative_path($$[QT_INSTALL_LIBS], $$qtRelativeRPathBase())
174 } else {
175 QMAKE_RPATHDIR += $$[QT_INSTALL_LIBS/dev]
176 }
177 }
178
179 !isEmpty(QMAKE_LFLAGS_RPATHLINK):!contains(QT_CONFIG, static) {
180 # -rpath-link is used by the linker to find dependencies of dynamic
181 # libraries which were NOT specified on the command line.
182 # This means that paths of direct dependencies (QT & QT_PRIVATE)
183 # don't need to be listed, unlike their private dependencies' paths.
184 privdep = $$resolve_depends(qt_module_deps, "QT.", ".depends" ".run_depends")
185 privdep -= $$qt_module_deps
186 rpaths =
187 for(dep, privdep): \
188 rpaths += $$eval(QT.$${dep}.libs)
189 QMAKE_RPATHLINKDIR *= $$unique(rpaths)
190 }
191
192 # static builds: link qml import plugins into the app.
193 contains(qt_module_deps, qml): \
194 contains(QT_CONFIG, static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
195 !isEmpty(QTREPOS) {
196 for (qrep, QTREPOS): \
197 exists($$qrep/qml): \
198 QMLPATHS += $$qrep/qml
199 } else {
200 QMLPATHS += $$[QT_INSTALL_QML/get]
201 }
202
203 # run qmlimportscanner
204 qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, , system)
205 for (QMLPATH, QMLPATHS): \
206 IMPORTPATHS += -importPath $$system_quote($$QMLPATH)
207
208 #message(run $$QMLIMPORTSCANNER $$_PRO_FILE_PWD_ $$IMPORTPATHS)
209 JSON = $$system($$QMLIMPORTSCANNER $$system_quote($$_PRO_FILE_PWD_) $$IMPORTPATHS)
210
211 parseJson(JSON, IMPORTS)| error("Failed to parse qmlimportscanner output.")
212
213 !isEmpty(IMPORTS._KEYS_) {
214 # add import plugins to LIBS line
215 for (key, IMPORTS._KEYS_) {
216 PATH = $$eval(IMPORTS.$${key}.path)
217 PLUGIN = $$eval(IMPORTS.$${key}.plugin)
218 !isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$${PLUGIN}$$qtPlatformTargetSuffix()
219 }
220
221 # create qml_plugin_import.cpp
222 IMPORT_FILE_CONT = \
223 "// This file is autogenerated by qmake. It imports static plugin classes for" \
224 "// static plugins used by QML imports." \
225 "$${LITERAL_HASH}include <QtPlugin>"
226 for (key, IMPORTS._KEYS_) {
227 PLUGIN = $$eval(IMPORTS.$${key}.plugin)
228 CLASSNAME = $$eval(IMPORTS.$${key}.classname)
229 !isEmpty(PLUGIN) {
230 !isEmpty(CLASSNAME) {
231 !contains(ADDED_IMPORTS, $$PLUGIN) {
232 ADDED_IMPORTS += $$PLUGIN
233 IMPORT_FILE_CONT += "Q_IMPORT_PLUGIN($$CLASSNAME)"
234 }
235 } else {
236 error("Plugin $$PLUGIN is missing a classname entry, please add one to the qmldir file.")
237 }
238 }
239 }
240 QML_IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_qml_plugin_import.cpp
241 write_file($$QML_IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.")
242 GENERATED_SOURCES += $$QML_IMPORT_CPP
243 QMAKE_DISTCLEAN += $$QML_IMPORT_CPP
244
245 # copy qml files. this part is platform spesific.
246 mac {
247 osx {
248 # Note: user can override QMAKE_BUNDLE_QML from pro file to change target bundle path
249 isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "Resources/qt_qml"
250 qmlTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/$$QMAKE_QML_BUNDLE_PATH
251 qtconfTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/Resources/qt.conf
252 } else {
253 # iOS: flat bundle layout (no Contents/Resources)
254 isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "qt_qml"
255 qmlTargetPath = $CODESIGNING_FOLDER_PATH/$$QMAKE_QML_BUNDLE_PATH
256 qtconfTargetPath = $CODESIGNING_FOLDER_PATH/qt.conf
257 }
258
259 # set import path in qt.conf to point to the bundeled qml:
260 QT_CONF_CONTENTS = \
261 "[Paths]" \
262 "Imports = $$QMAKE_QML_BUNDLE_PATH" \
263 "Qml2Imports = $$QMAKE_QML_BUNDLE_PATH"
264 write_file("$$OUT_PWD/qt.conf", QT_CONF_CONTENTS)|error("Aborting.")
265
266 # write qt.conf and copy each qml import dir into the bundle.
267 # But strip away archives and other files that are not needed:
268 !isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK += ";"
269 QMAKE_POST_LINK += \
270 "cp $$shell_quote($$OUT_PWD/qt.conf) \"$$qtconfTargetPath\"; " \
271 "test -d \"$$qmlTargetPath\" && rm -r \"$$qmlTargetPath\"; " \
272 "mkdir -p \"$$qmlTargetPath\" && " \
273 "for p in $$QMLPATHS; do" \
274 "rsync -r --exclude='*.a' --exclude='*.prl' --exclude='*.qmltypes' "
275 macx-xcode: QMAKE_POST_LINK += "$p/ \"$$qmlTargetPath\"; done"
276 else: QMAKE_POST_LINK += "\$\$p/ \"$$qmlTargetPath\"; done"
277 }
278 }
279 }
280
281 !import_qpa_plugin {
282 warning("CONFIG-=import_qpa_plugin is deprecated. Use QTPLUGIN.platforms=- instead.")
283 QTPLUGIN.platforms = -
284 } else: qpa_minimal_plugin {
285 warning("CONFIG+=qpa_minimal_plugin is deprecated. Use QTPLUGIN.platforms=qminimal instead.")
286 QTPLUGIN.platforms = qminimal
287 }
288
289 contains(TEMPLATE, .*app) {
290 autoplugs =
291 for (qtmod, qt_module_deps) {
292 for (ptype, QT.$${qtmod}.plugin_types) {
293 isEmpty(QTPLUGIN.$$ptype) {
294 for (plug, QT_PLUGINS) {
295 equals(QT_PLUGIN.$${plug}.TYPE, $$ptype) {
296 for (dep, QT_PLUGIN.$${plug}.EXTENDS) {
297 !contains(qt_module_deps, $$dep) {
298 plug =
299 break()
300 }
301 }
302 autoplugs += $$plug
303 }
304 }
305 } else {
306 plug = $$eval(QTPLUGIN.$$ptype)
307 !equals(plug, -): \
308 autoplugs += $$plug
309 }
310 }
311 }
312 manualplugs = $$QTPLUGIN
313 manualplugs -= $$autoplugs
314 QTPLUGIN -= $$manualplugs
315 !isEmpty(QTPLUGIN): \
316 warning("Redundant entries in QTPLUGIN: $$QTPLUGIN")
317 QTPLUGIN = $$manualplugs $$autoplugs
318 }
319
320 QT_PLUGIN_VERIFY = DEPLOYMENT_PLUGIN
321 contains(QT_CONFIG, static) {
322 QT_PLUGIN_VERIFY += QTPLUGIN
323 force_import_plugins|contains(TEMPLATE, .*app) {
324 import_plugins:!isEmpty(QTPLUGIN) {
325 IMPORT_FILE_CONT = \
326 "// This file is autogenerated by qmake. It imports static plugin classes for" \
327 "// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables." \
328 "$${LITERAL_HASH}include <QtPlugin>"
329 for(IMPORT_PLUG, $$list($$unique(QTPLUGIN))) {
330 PLUG_CLASS = $$eval(QT_PLUGIN.$${IMPORT_PLUG}.CLASS_NAME)
331 !isEmpty(PLUG_CLASS): \
332 IMPORT_FILE_CONT += "Q_IMPORT_PLUGIN($$PLUG_CLASS)"
333 else: \
334 warning("Plugin class name could not be determined for $$IMPORT_PLUG plugin.")
335 }
336 IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_import.cpp
337 write_file($$IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.")
338 GENERATED_SOURCES += $$IMPORT_CPP
339 QMAKE_DISTCLEAN += $$IMPORT_CPP
340 }
341 }
342 }
343
344 for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
345 for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
346 # Check if the plugin is known to Qt. We can use this to determine
347 # the plugin path. Unknown plugins must rely on the default link path.
348 QT_PLUGINPATH = $$eval(QT_PLUGIN.$${QTPLUG}.TYPE)
349
350 # Generate the plugin linker line
351 QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix()
352
353 # Only link against plugin in static builds
354 isEqual(QT_CURRENT_VERIFY, QTPLUGIN) {
355 !isEmpty(QT_PLUGINPATH) {
356 plugpath = $$eval(QT_PLUGIN.$${QTPLUG}.PATH)
357 isEmpty(plugpath): \
358 plugpath = $$[QT_INSTALL_PLUGINS/get]
359 LIBS *= -L$$plugpath/$$QT_PLUGINPATH
360 }
361 LIBS += $$QT_LINKAGE
362 # if the plugin is linked statically there is no need to deploy it
363 DEPLOYMENT_PLUGIN -= $$QT_CURRENT_VERIFY
364 }
365
366 # The following block is currently broken, because qt_plugin_XXX.prf files
367 # are not generated for dynamic builds.
368 false:isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:if(wince*|winrt) {
369 QT_ITEM =
370 debug: QT_ITEM = $${QTPLUG}d4.dll
371 else: QT_ITEM = $${QTPLUG}4.dll
372
373 qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM}
374 qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH}
375
376 INSTALLS *= qt_additional_plugin_$${QTPLUG}
377 }
378 }
379 }