summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt.prf
blob: 28f8c8dd6dded7258daa6aa39612780573f6c873 (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
127
128
129
130
131
132
133
134
135
136
137
138
139
CONFIG *= thread

#handle defines
win32 {
   # ### QT_NODLL and QT_DLL are compatibility, remove before the Qt 5.0 release
   contains(QT_CONFIG, shared) {
      DEFINES += QT_DLL

      # this variable is read by qmake in qmake/generators/win32/msvc_vcproj.cpp
      # function VcprojGenerator::initDeploymentTool(), which contains some hardcoded
      # library names (the ones that were static in Qt 4)
      # it probably doesn't work anymore and should not be in this file
      QMAKE_QT_DLL = 1
   } else {
      DEFINES += QT_NODLL
   }
}
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG
contains(QT_CONFIG, force_asserts):DEFINES += QT_FORCE_ASSERTS
no_keywords:DEFINES += QT_NO_KEYWORDS
plugin { #Qt plugins
   static:DEFINES += QT_STATICPLUGIN
   DEFINES += QT_PLUGIN

   # Triggers both on Qt being configured with -arch boundschecker,
   # and if you qmake CONFIG+=boundchecker on your plugin project
   boundschecker|contains(QT_CONFIG,boundschecker) {
      # This option is added for plugins when Qt is configured for Boundschecker,
      # since we want Boundschecker to not instrument the qt_plugin_query_verification_data
      # function, as we call that function without the plugin's dependent DLLs, thus
      # Boundscheckers instrumentation will fail. The function only returns a const char *,
      # so no instrumentation is really needed on that function anyways.
      QMAKE_CFLAGS += /nmignore:*:qt_plugin_query_verification_data
      QMAKE_CXXFLAGS += /nmignore:*:qt_plugin_query_verification_data
   }
}

QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN
for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
    for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
       # Check if the plugin is known to Qt. We can use this to determine
       # the plugin path. Unknown plugins must rely on the default link path.
       ACCESSIBLEPLUGINS = qtaccessiblewidgets qtaccessiblecompatwidgets
       BEARERPLUGINS = qgenericbearer qnativewifibearer
       CODECPLUGINS = qcncodecs qjpcodecs qkrcodecs qtwcodecs
       DECORATIONPLUGINS = qdecorationdefault qdecorationstyled qdecorationwindows
       GFXDRIVERPLUGINS = qscreenvfb qgfxtransformed qgfxshadowfb qgfxpvregl qscreenlinuxfb qeglnullws qdirectfbscreen qahiscreen
       GRAPHICSSYSTEMPLUGINS = qmeegographicssystem qglgraphicssystem qvggraphicssystem qshivavggraphicssystem
       IMAGEPLUGINS = qgif qico qjpeg qsvg
       INPUTPLUGINS = qimsw-multi
       KBDDRIVERPLUGINS = qlinuxinputkbddriver
       MOUSEDRIVERPLUGINS = qtslibmousehandler qpcmousedriver qlinuxtpmousedriver
       SQLPLUGINS = qsqldb2 qsqloci qsqltds qsqlodbc qsqlpsql qsqlibase qsqlmysql qsqlite2 qsqlite
       PHONONPLUGINS = phonon_waveout phonon_ds9 phonon_gstreamer phonon_qt7 phonon_mmf

       ALLQTPLUGINS = $$ACCESSIBLEPLUGINS $$BEARERPLUGINS $$CODECPLUGINS $$DECORATIONPLUGINS $$GFXDRIVERPLUGINS $$GRAPHICSSYSTEMPLUGINS $$IMAGEPLUGINS $$INPUTPLUGINS $$KBDDRIVERPLUGINS $$MOUSEDRIVERPLUGINS $$SQLPLUGINS $$PHONONPLUGINS

       QT_PLUGINPATH =
       contains(ALLQTPLUGINS, $$QTPLUG) {
           # Determine the plugin path
           contains(ACCESSIBLEPLUGINS, $$QTPLUG): QT_PLUGINPATH = accessible
           contains(BEARERPLUGINS, $$QTPLUG): QT_PLUGINPATH = bearer
           contains(CODECPLUGINS, $$QTPLUG): QT_PLUGINPATH = codecs
           contains(DECORATIONPLUGINS, $$QTPLUG): QT_PLUGINPATH = decorations
           contains(GFXDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = gfxdrivers
           contains(GRAPHICSSYSTEMPLUGINS, $$QTPLUG): QT_PLUGINPATH = graphicssystems
           contains(IMAGEPLUGINS, $$QTPLUG): QT_PLUGINPATH = imageformats
           contains(INPUTPLUGINS, $$QTPLUG): QT_PLUGINPATH = inputmethods
           contains(KBDDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = kbddrivers
           contains(MOUSEDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = mousedrivers
           contains(SQLPLUGINS, $$QTPLUG):  QT_PLUGINPATH = sqldrivers
           contains(PHONONPLUGINS, $$QTPLUG): QT_PLUGINPATH = phonon_backend
        }

        # Generate the plugin linker line
        target_qt:isEqual(TARGET, QTPLUG) {
            warning($$TARGET cannot have a QTPLUGIN of $$QTPLUG)
        } else {
            QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix()
        }

        # Only link against plugin in static builds
        isEqual(QT_CURRENT_VERIFY, QTPLUGIN): {
            !isEmpty(QT_PLUGINPATH): LIBS *= -L$$[QT_INSTALL_PLUGINS/get]/$$QT_PLUGINPATH
                LIBS += $$QT_LINKAGE
            # if the plugin is linked statically there is no need to deploy it
            DEPLOYMENT_PLUGIN -= $$QT_CURRENT_VERIFY
        }
        isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:wince*: {
            QT_ITEM =
            CONFIG(debug, debug|release): QT_ITEM = $${QTPLUG}d4.dll
            else: QT_ITEM = $${QTPLUG}4.dll

            eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM})
            eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})

            DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
        }
    }
}

qtestlib {
    warning("CONFIG+=qtestlib is deprecated. Use QT+=testlib instead.")
    QT += testlib
}
qdbus {
    warning("CONFIG+=qdbus is deprecated. Use QT+=dbus instead.")
    QT += dbus
}
help {
    warning("CONFIG+=help is deprecated. Use QT+=help instead.")
    QT += help-private   # sic!
}
designer {
    warning("CONFIG+=designer is deprecated. Use QT+=designer instead.")
    QT += designer
}
uitools {
    warning("CONFIG+=uitools is deprecated. Use QT+=uitools instead.")
    QT += uitools
}

unset(using_privates)
qtAddModules(QT, LIBS)
qtAddModules(QT_PRIVATE, LIBS_PRIVATE)
!isEmpty(using_privates):!auto_use_privates:!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) {
    message("This project is using private headers and will therefore be tied to this specific Qt module build version.")
    message("Running this project against other versions of the Qt modules may crash at any arbitrary point.")
    message("This is not a bug, but a result of using Qt internals. You have been warned!")
}

wince*:static:gui {
   QTLIB += qmenu_wce.res
}

!isEmpty(QT_NAMESPACE):DEFINES *= QT_NAMESPACE=$$QT_NAMESPACE
mac {
    !isEmpty(QT_NAMESPACE_MAC_CRC):DEFINES *= QT_NAMESPACE_MAC_CRC=$$QT_NAMESPACE_MAC_CRC
}