source: branches/vendor/trolltech/qt/current/mkspecs/features/qt.prf @ 2

Last change on this file since 2 was 2, checked in by Dmitry A. Kuminov, 12 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 7.3 KB
Line 
1CONFIG *= moc thread
2
3#handle defines
4win32 {
5   qt_static:DEFINES += QT_NODLL
6   !contains(DEFINES, QT_NODLL) {
7      QT_ENV_DLL = $$(QT_DLL)
8      QT_ENV_NO_DLL = $$(QT_NODLL)
9      isEmpty(QT_ENV_NO_DLL) {
10          shared|!isEmpty(QT_ENV_DLL):DEFINES += QT_DLL
11      }
12      contains(DEFINES, QT_MAKEDLL)|contains(DEFINES, QT_DLL):QMAKE_QT_DLL = 1
13   }
14}
15CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG
16no_keywords:DEFINES += QT_NO_KEYWORDS
17plugin { #Qt plugins
18   static:DEFINES += QT_STATICPLUGIN
19   DEFINES += QT_PLUGIN
20
21   # Triggers both on Qt being configured with -arch boundschecker,
22   # and if you qmake CONFIG+=boundchecker on your plugin project
23   boundschecker|contains(QT_CONFIG,boundschecker) {
24      # This option is added for plugins when Qt is configured for Boundschecker,
25      # since we want Boundschecker to not instrument the qt_plugin_query_verification_data
26      # function, as we call that function without the plugin's dependent DLLs, thus
27      # Boundscheckers instrumentation will fail. The function only returns a const char *,
28      # so no instrumentation is really needed on that function anyways.
29      QMAKE_CFLAGS += /nmignore:*:qt_plugin_query_verification_data
30      QMAKE_CXXFLAGS += /nmignore:*:qt_plugin_query_verification_data
31   }
32}
33
34#handle includes
35INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picking up "stale" includes
36win32:INCLUDEPATH += $$QMAKE_INCDIR_QT/ActiveQt
37
38# As order does matter for static libs, we reorder the QT variable here
39TMPLIBS = webkit phonon dbus testlib script scripttools svg qt3support sql xmlpatterns xml opengl gui network core
40for(QTLIB, $$list($$TMPLIBS)) {
41   contains(QT, $$QTLIB): QT_ORDERED += $$QTLIB
42}
43
44QT_UNKNOWN = $$QT
45QT_UNKNOWN -= $$QT_ORDERED
46QT = $$QT_ORDERED
47for(QTLIB, $$list($$QT_UNKNOWN)) {
48   !contains(TMPLIBS, $$QTLIB):message("Warning: unknown QT: $$QTLIB")
49}
50
51QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN
52for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
53    for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
54       qplugin_style =
55       !qt_debug:!qt_release {
56          CONFIG(debug, debug|release):qplugin_style = debug
57          else:qplugin_style = release
58       } else:CONFIG(qt_debug, qt_debug|qt_release) {
59          qplugin_style = debug
60       } else {
61          qplugin_style = release
62       }
63
64       # Check if the plugin is known to Qt. We can use this to determine
65       # the plugin path. Unknown plugins must rely on the default link path.
66       ACCESSIBLEPLUGINS = qtaccessiblewidgets qtaccessiblecompatwidgets
67       CODECPLUGINS = qcncodecs qjpcodecs qkrcodecs qtwcodecs
68       DECORATIONPLUGINS = qdecorationdefault qdecorationwindows
69       GFXDRIVERPLUGINS = qgfxvnc qscreenvfb qgfxsnap qgfxvga16 qgfxmatrox qgfxvoodoo qgfxtransformed qgfxshadowfb
70       IMAGEPLUGINS = qgif qmng qjpeg qsvg
71       INPUTPLUGINS = qimsw-multi
72       MOUSEDRIVERPLUGINS = qtslibmousehandler
73       SQLPLUGINS = qsqldb2 qsqloci qsqltds qsqlodbc qsqlpsql qsqlibase qsqlmysql qsqlite2 qsqlite
74       PHONONPLUGINS = phonon_waveout phonon_ds9
75
76       ALLQTPLUGINS = $$ACCESSIBLEPLUGINS $$CODECPLUGINS $$DECORATIONPLUGINS $$GFXDRIVERPLUGINS $$IMAGEPLUGINS $$INPUTPLUGINS $$MOUSEDRIVERPLUGINS $$SQLPLUGINS $$PHONONPLUGINS
77
78       QT_PLUGINPATH =
79       contains(ALLQTPLUGINS, $$QTPLUG) {
80           # Determine the plugin path
81           contains(ACCESSIBLEPLUGINS, $$QTPLUG): QT_PLUGINPATH = accessible
82           contains(CODECPLUGINS, $$QTPLUG): QT_PLUGINPATH = codecs
83           contains(DECORATIONPLUGINS, $$QTPLUG): QT_PLUGINPATH = decorations
84           contains(GFXDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = gfxdrivers
85           contains(IMAGEPLUGINS, $$QTPLUG): QT_PLUGINPATH = imageformats
86           contains(INPUTPLUGINS, $$QTPLUG): QT_PLUGINPATH = inputmethods
87           contains(MOUSEDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = mousedrivers
88           contains(SQLPLUGINS, $$QTPLUG):  QT_PLUGINPATH = sqldrivers
89           contains(PHONONPLUGINS, $$QTPLUG): QT_PLUGINPATH = phonon_backend
90        }
91
92        # Generate the plugin linker line
93        target_qt:isEqual(TARGET, QTPLUG) {
94            warning($$TARGET cannot have a QTPLUGIN of $$QTPLUG)
95        } else {
96            QT_LINKAGE = -l$${QTPLUG}
97            win32 {
98               CONFIG(debug, debug|release):QT_LINKAGE = -l$${QTPLUG}d
99            } else:mac {
100               isEqual(qplugin_style, debug):QT_LINKAGE = -l$${QTPLUG}_debug
101            }
102        }
103
104        # Only link against plugin in static builds
105        isEqual(QT_CURRENT_VERIFY, QTPLUGIN): {
106            !isEmpty(QT_PLUGINPATH): LIBS *= -L$$[QT_INSTALL_PLUGINS]/$$QT_PLUGINPATH
107                LIBS += $$QT_LINKAGE
108            # if the plugin is linked statically there is no need to deploy it
109            DEPLOYMENT_PLUGIN -= $$QT_CURRENT_VERIFY
110        }
111        isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:wince*: {
112            QT_ITEM =
113            CONFIG(debug, debug|release): QT_ITEM = $${QTPLUG}d4.dll
114            else: QT_ITEM = $${QTPLUG}4.dll
115
116            eval(qt_additional_plugin_$${QTPLUG}.sources = $$[QT_INSTALL_PLUGINS]/$${QT_PLUGINPATH}/$${QT_ITEM})
117            eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})
118
119            DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
120        }
121    }
122}
123#specific module settings
124!isEmpty(QT_BUILD_TREE):QMAKE_LIBDIR = $$QT_BUILD_TREE/lib $$QMAKE_LIBDIR #as above, prepending prevents us from picking up "stale" libs
125QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT
126for(QTLIB, $$list($$lower($$unique(QT)))) {
127   unset(qlib_style)
128   !qt_debug:!qt_release {
129      CONFIG(debug, debug|release):qlib_style = debug
130      else:qlib_style = release
131   } else:CONFIG(qt_debug, qt_debug|qt_release) {
132      qlib_style = debug
133   } else {
134      qlib_style = release
135   }
136
137   unset(qlib)
138   isEqual(QTLIB, gui):qlib = QtGui
139   else:isEqual(QTLIB, network):qlib = QtNetwork
140   else:isEqual(QTLIB, xml):qlib = QtXml
141   else:isEqual(QTLIB, xmlpatterns):qlib = QtXmlPatterns
142   else:isEqual(QTLIB, opengl):qlib = QtOpenGL
143   else:isEqual(QTLIB, sql):qlib = QtSql
144   else:isEqual(QTLIB, core):qlib = QtCore
145   else:isEqual(QTLIB, canvas):qlib = QtCanvas
146   else:isEqual(QTLIB, qt3support):qlib = Qt3Support
147   else:isEqual(QTLIB, svg):qlib = QtSvg
148   else:isEqual(QTLIB, script):qlib = QtScript
149   else:isEqual(QTLIB, scripttools):qlib = QtScriptTools
150   else:isEqual(QTLIB, testlib):qlib = QtTest
151   else:isEqual(QTLIB, dbus):qlib = QtDBus
152   else:isEqual(QTLIB, phonon):qlib = phonon
153   else:isEqual(QTLIB, webkit):qlib = QtWebKit
154   else:message("Unknown QT: $$QTLIB"):qlib =
155   !isEmpty(qlib) {
156      target_qt:isEqual(TARGET, qlib) {
157         warning($$TARGET cannot have a QT of $$QTLIB)
158      } else {
159         DEFINES *= $$upper(QT_$${QTLIB}_LIB)
160         isEqual(QTLIB, opengl):CONFIG += opengl
161         isEqual(QTLIB, qt3support):DEFINES *= QT3_SUPPORT
162         isEqual(QTLIB, testlib):CONFIG += console
163         isEqual(QTLIB, dbus):CONFIG += dbusadaptors dbusinterfaces
164
165     qtAddLibrary($$qlib)
166      }
167   }
168}
169
170qt_compat {
171   !qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us
172   INCLUDEPATH *= $$QMAKE_INCDIR_QT/Qt
173   DEFINES *= QT_COMPAT
174}
175
176wince*:static:gui {
177   QTLIB += qmenu_wce.res
178}
179
180!isEmpty(QT_NAMESPACE):DEFINES *= QT_NAMESPACE=$$QT_NAMESPACE
181mac {
182    !isEmpty(QT_NAMESPACE_MAC_CRC):DEFINES *= QT_NAMESPACE_MAC_CRC=$$QT_NAMESPACE_MAC_CRC
183}
Note: See TracBrowser for help on using the repository browser.