summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt.prf
blob: a790b60f48220f0cedbd289e76acf11d3b1d28d7 (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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
CONFIG *= moc thread

#handle defines
win32 {
   qt_static:DEFINES += QT_NODLL
   !contains(DEFINES, QT_NODLL) {
      QT_ENV_DLL = $$(QT_DLL)
      QT_ENV_NO_DLL = $$(QT_NODLL)
      isEmpty(QT_ENV_NO_DLL) {
          shared|!isEmpty(QT_ENV_DLL):DEFINES += QT_DLL
      }
      contains(DEFINES, QT_MAKEDLL)|contains(DEFINES, QT_DLL):QMAKE_QT_DLL = 1
   }
}
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG
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
   }
}

#handle includes
INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picking up "stale" includes
win32:INCLUDEPATH += $$QMAKE_INCDIR_QT/ActiveQt

# As order does matter for static libs, we reorder the QT variable here
TMPLIBS = webkit phonon dbus testlib script scripttools svg qt3support sql xmlpatterns xml opengl gui network core
for(QTLIB, $$list($$TMPLIBS)) {
   contains(QT, $$QTLIB): QT_ORDERED += $$QTLIB
}

QT_UNKNOWN = $$QT
QT_UNKNOWN -= $$QT_ORDERED
QT = $$QT_ORDERED
for(QTLIB, $$list($$QT_UNKNOWN)) {
   !contains(TMPLIBS, $$QTLIB):message("Warning: unknown QT: $$QTLIB")
}

QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN
for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
    for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
       qplugin_style =
       !qt_debug:!qt_release {
          CONFIG(debug, debug|release):qplugin_style = debug
          else:qplugin_style = release
       } else:CONFIG(qt_debug, qt_debug|qt_release) {
          qplugin_style = debug
       } else {
          qplugin_style = release
       }

       # 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
       CODECPLUGINS = qcncodecs qjpcodecs qkrcodecs qtwcodecs
       DECORATIONPLUGINS = qdecorationdefault qdecorationwindows
       GFXDRIVERPLUGINS = qgfxvnc qscreenvfb qgfxsnap qgfxvga16 qgfxmatrox qgfxvoodoo qgfxtransformed qgfxshadowfb
       IMAGEPLUGINS = qgif qmng qjpeg qsvg
       INPUTPLUGINS = qimsw-multi
       MOUSEDRIVERPLUGINS = qtslibmousehandler
       SQLPLUGINS = qsqldb2 qsqloci qsqltds qsqlodbc qsqlpsql qsqlibase qsqlmysql qsqlite2 qsqlite
       PHONONPLUGINS = phonon_waveout phonon_ds9

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

       QT_PLUGINPATH =
       contains(ALLQTPLUGINS, $$QTPLUG) {
           # Determine the plugin path
           contains(ACCESSIBLEPLUGINS, $$QTPLUG): QT_PLUGINPATH = accessible
           contains(CODECPLUGINS, $$QTPLUG): QT_PLUGINPATH = codecs
           contains(DECORATIONPLUGINS, $$QTPLUG): QT_PLUGINPATH = decorations
           contains(GFXDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = gfxdrivers
           contains(IMAGEPLUGINS, $$QTPLUG): QT_PLUGINPATH = imageformats
           contains(INPUTPLUGINS, $$QTPLUG): QT_PLUGINPATH = inputmethods
           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}
            win32 {
               CONFIG(debug, debug|release):QT_LINKAGE = -l$${QTPLUG}d
            } else:mac {
               isEqual(qplugin_style, debug):QT_LINKAGE = -l$${QTPLUG}_debug
            }
        }

        # Only link against plugin in static builds
        isEqual(QT_CURRENT_VERIFY, QTPLUGIN): {
            !isEmpty(QT_PLUGINPATH): LIBS *= -L$$[QT_INSTALL_PLUGINS]/$$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}.sources = $$[QT_INSTALL_PLUGINS]/$${QT_PLUGINPATH}/$${QT_ITEM})
            eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})

            DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
        }
        isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:symbian: {
            QT_ITEM = $${QTPLUG}.dll

            eval(qt_additional_plugin_$${QTPLUG}.sources = $${QT_ITEM})
            eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})

            DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
        }
    }
}
#specific module settings
!isEmpty(QT_BUILD_TREE):QMAKE_LIBDIR = $$QT_BUILD_TREE/lib $$QMAKE_LIBDIR #as above, prepending prevents us from picking up "stale" libs
QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT
for(QTLIB, $$list($$lower($$unique(QT)))) {
   unset(qlib_style)
   !qt_debug:!qt_release {
      CONFIG(debug, debug|release):qlib_style = debug
      else:qlib_style = release
   } else:CONFIG(qt_debug, qt_debug|qt_release) {
      qlib_style = debug
   } else {
      qlib_style = release
   }

   unset(qlib)
   isEqual(QTLIB, gui):qlib = QtGui
   else:isEqual(QTLIB, network):qlib = QtNetwork
   else:isEqual(QTLIB, xml):qlib = QtXml
   else:isEqual(QTLIB, xmlpatterns):qlib = QtXmlPatterns
   else:isEqual(QTLIB, opengl):qlib = QtOpenGL
   else:isEqual(QTLIB, sql):qlib = QtSql
   else:isEqual(QTLIB, core):qlib = QtCore
   else:isEqual(QTLIB, canvas):qlib = QtCanvas
   else:isEqual(QTLIB, qt3support):qlib = Qt3Support
   else:isEqual(QTLIB, svg):qlib = QtSvg
   else:isEqual(QTLIB, script):qlib = QtScript
   else:isEqual(QTLIB, scripttools):qlib = QtScriptTools
   else:isEqual(QTLIB, testlib):qlib = QtTest
   else:isEqual(QTLIB, dbus):qlib = QtDBus
   else:isEqual(QTLIB, phonon):qlib = phonon
   else:isEqual(QTLIB, webkit):qlib = QtWebKit
   else:message("Unknown QT: $$QTLIB"):qlib =
   !isEmpty(qlib) {
      target_qt:isEqual(TARGET, qlib) {
         warning($$TARGET cannot have a QT of $$QTLIB)
      } else {
         DEFINES *= $$upper(QT_$${QTLIB}_LIB)
	 isEqual(QTLIB, opengl):CONFIG += opengl
	 isEqual(QTLIB, qt3support):DEFINES *= QT3_SUPPORT
         isEqual(QTLIB, testlib):CONFIG += console
         isEqual(QTLIB, dbus):CONFIG += dbusadaptors dbusinterfaces

     qtAddLibrary($$qlib)
      }
   }
}

qt_compat {
   !qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us
   INCLUDEPATH *= $$QMAKE_INCDIR_QT/Qt
   DEFINES *= QT_COMPAT
}

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
}