[Qt] Fix build against Qt5 after refactor of widgets out of QtGUi
[WebKit-https.git] / Source / WebKit / qt / QtWebKit.pro
1 # QtWebKit - qmake build info
2 CONFIG += building-libs
3 CONFIG += depend_includepath
4
5 TARGET = QtWebKit
6 TEMPLATE = lib
7
8 DEFINES += BUILDING_WEBKIT
9
10 webkit2: QT += declarative
11
12 RESOURCES += \
13     $$PWD/../../WebCore/WebCore.qrc
14
15 CONFIG(debug, debug|release) : CONFIG_DIR = debug
16 else: CONFIG_DIR = release
17
18 SOURCE_DIR = $$replace(PWD, /WebKit/qt, "")
19
20 include($$PWD/Api/headers.pri)
21 include($$SOURCE_DIR/WebKit.pri)
22 include($$SOURCE_DIR/JavaScriptCore/JavaScriptCore.pri)
23 webkit2 {
24     include($$SOURCE_DIR/WebKit2/WebKit2.pri)
25     include($$SOURCE_DIR/WebKit2/WebKit2API.pri)
26 }
27 include($$SOURCE_DIR/WebCore/WebCore.pri)
28
29 v8 {
30     linux-* {
31         QMAKE_LIBDIR += $${V8_LIB_DIR}
32         LIBS = -lv8 $$LIBS
33     }
34 }
35
36 !v8:prependJavaScriptCoreLib(../../JavaScriptCore)
37 prependWebCoreLib(../../WebCore)
38 webkit2:prependWebKit2Lib(../../WebKit2)
39
40 # This is needed for syncqt when it parses the dependencies on module's main pro file so
41 # the generated includes are containing the dependencies.
42 # It used to be in WebCore.pro but now that this is the main pro file it has to be here.
43 QT += network
44 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
45
46 isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..
47
48 contains(QT_CONFIG, embedded):CONFIG += embedded
49
50 win32*:!win32-msvc* {
51     # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
52     contains(DEFINES, ENABLE_WEBGL=1)|contains(CONFIG, texmap): LIBS += $$QMAKE_LIBS_OPENGL
53 }
54
55 include_webinspector: RESOURCES += $$SOURCE_DIR/WebCore/inspector/front-end/WebKit.qrc $$WC_GENERATED_SOURCES_DIR/InspectorBackendStub.qrc
56
57 # Extract sources to build from the generator definitions
58 defineTest(addExtraCompiler) {
59     isEqual($${1}.wkAddOutputToSources, false): return(true)
60
61     outputRule = $$eval($${1}.output)
62     input = $$eval($${1}.input)
63     input = $$eval($$input)
64
65     for(file,input) {
66         base = $$basename(file)
67         base ~= s/\\..+//
68         newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
69         SOURCES += $$newfile
70     }
71     SOURCES += $$eval($${1}.wkExtraSources)
72     export(SOURCES)
73
74     return(true)
75 }
76
77 include($$SOURCE_DIR/WebCore/CodeGenerators.pri)
78
79 CONFIG(release):!CONFIG(standalone_package) {
80     contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
81     unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
82 }
83
84 CONFIG(QTDIR_build) {
85     include($$QT_SOURCE_TREE/src/qbase.pri)
86     # The following lines are to prevent qmake from adding the jscore, webcore and webkit2 libs to libQtWebKit's prl dependencies.
87     # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit and QtScript
88     # statically in applications (which isn't used often because, among other things, of licensing obstacles).
89     CONFIG -= explicitlib
90     CONFIG -= staticlib
91 } else {
92     DESTDIR = $$OUTPUT_DIR/lib
93     symbian: TARGET =$$TARGET$${QT_LIBINFIX}
94 }
95
96 moduleFile=$$PWD/qt_webkit_version.pri
97 isEmpty(QT_BUILD_TREE):include($$moduleFile)
98 VERSION = $${QT_WEBKIT_MAJOR_VERSION}.$${QT_WEBKIT_MINOR_VERSION}.$${QT_WEBKIT_PATCH_VERSION}
99
100 symbian {
101     TARGET.EPOCALLOWDLLDATA=1
102     # DRM and Allfiles capabilites need to be audited to be signed on Symbian
103     # For regular users that is not possible, so use the CONFIG(production) flag is added
104     # To use all capabilies add CONFIG+=production
105     # If building from QT source tree, also add CONFIG-=QTDIR_build as qbase.pri defaults capabilities to All -Tcb.    
106     CONFIG(production) {
107         TARGET.CAPABILITY = All -Tcb
108     } else {
109         TARGET.CAPABILITY = All -Tcb -DRM -AllFiles
110     }
111     isEmpty(QT_LIBINFIX) {
112         TARGET.UID3 = 0x200267C2
113     } else {
114         TARGET.UID3 = 0xE00267C2
115     }
116     
117     sisheader = "; SIS header: name, uid, version" \
118                 "$${LITERAL_HASH}{\"$$TARGET\"},($$TARGET.UID3),$$QT_WEBKIT_MAJOR_VERSION,$$QT_WEBKIT_MINOR_VERSION,$$QT_WEBKIT_PATCH_VERSION,TYPE=SA,RU"
119     webkitsisheader.pkg_prerules = sisheader
120
121     webkitlibs.sources = QtWebKit$${QT_LIBINFIX}.dll
122     v8:webkitlibs.sources += v8.dll
123
124     CONFIG(QTDIR_build): webkitlibs.sources = $$QMAKE_LIBDIR_QT/$$webkitlibs.sources
125     webkitlibs.path = /sys/bin
126     vendorinfo = \
127         "; Localised Vendor name" \
128         "%{\"Nokia\"}" \
129         " " \
130         "; Unique Vendor name" \
131         ":\"Nokia, Qt\"" \
132         " "
133     webkitlibs.pkg_prerules = vendorinfo
134
135     webkitbackup.sources = symbian/backup_registration.xml
136     webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
137
138     contains(QT_CONFIG, declarative) {
139          declarativeImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
140          declarativeImport.sources += declarative/qmldir
141          declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
142          DEPLOYMENT += declarativeImport
143     }
144
145     platformplugin.sources = $$OUTPUT_DIR/plugins/QtWebKit/platformplugin$${QT_LIBINFIX}.dll
146     platformplugin.path = c:$$QT_PLUGINS_BASE_DIR/QtWebKit
147
148     DEPLOYMENT += webkitsisheader webkitlibs webkitbackup platformplugin
149     !CONFIG(production):CONFIG-=def_files
150
151     # Need to build these sources here because of exported symbols
152     SOURCES += \
153         $$SOURCE_DIR/WebCore/plugins/symbian/PluginViewSymbian.cpp \
154         $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.cpp
155
156     HEADERS += \
157         $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.h \
158         $$SOURCE_DIR/WebCore/plugins/symbian/npinterface.h
159 }
160
161 !static: DEFINES += QT_MAKEDLL
162
163 SOURCES += \
164     $$PWD/Api/qwebframe.cpp \
165     $$PWD/Api/qgraphicswebview.cpp \
166     $$PWD/Api/qwebpage.cpp \
167     $$PWD/Api/qwebview.cpp \
168     $$PWD/Api/qwebelement.cpp \
169     $$PWD/Api/qwebhistory.cpp \
170     $$PWD/Api/qwebsettings.cpp \
171     $$PWD/Api/qwebhistoryinterface.cpp \
172     $$PWD/Api/qwebplugindatabase.cpp \
173     $$PWD/Api/qwebpluginfactory.cpp \
174     $$PWD/Api/qwebsecurityorigin.cpp \
175     $$PWD/Api/qwebscriptworld.cpp \
176     $$PWD/Api/qwebdatabase.cpp \
177     $$PWD/Api/qwebinspector.cpp \
178     $$PWD/Api/qwebkitversion.cpp \
179     \
180     $$PWD/WebCoreSupport/QtFallbackWebPopup.cpp \
181     $$PWD/WebCoreSupport/QtWebComboBox.cpp \
182     $$PWD/WebCoreSupport/ChromeClientQt.cpp \
183     $$PWD/WebCoreSupport/ContextMenuClientQt.cpp \
184     $$PWD/WebCoreSupport/DragClientQt.cpp \
185     $$PWD/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
186     $$PWD/WebCoreSupport/EditorClientQt.cpp \
187     $$PWD/WebCoreSupport/EditCommandQt.cpp \
188     $$PWD/WebCoreSupport/FrameLoaderClientQt.cpp \
189     $$PWD/WebCoreSupport/FrameNetworkingContextQt.cpp \
190     $$PWD/WebCoreSupport/GeolocationPermissionClientQt.cpp \
191     $$PWD/WebCoreSupport/InspectorClientQt.cpp \
192     $$PWD/WebCoreSupport/InspectorServerQt.cpp \
193     $$PWD/WebCoreSupport/NotificationPresenterClientQt.cpp \
194     $$PWD/WebCoreSupport/PageClientQt.cpp \
195     $$PWD/WebCoreSupport/PopupMenuQt.cpp \
196     $$PWD/WebCoreSupport/QtPlatformPlugin.cpp \
197     $$PWD/WebCoreSupport/SearchPopupMenuQt.cpp \
198     $$PWD/WebCoreSupport/TextCheckerClientQt.cpp \
199     $$PWD/WebCoreSupport/WebPlatformStrategies.cpp
200
201 HEADERS += \
202     $$WEBKIT_API_HEADERS \
203     $$PWD/Api/qwebplugindatabase_p.h \
204     \
205     $$PWD/WebCoreSupport/InspectorServerQt.h \
206     $$PWD/WebCoreSupport/QtFallbackWebPopup.h \
207     $$PWD/WebCoreSupport/QtWebComboBox.h \
208     $$PWD/WebCoreSupport/FrameLoaderClientQt.h \
209     $$PWD/WebCoreSupport/FrameNetworkingContextQt.h \
210     $$PWD/WebCoreSupport/GeolocationPermissionClientQt.h \
211     $$PWD/WebCoreSupport/NotificationPresenterClientQt.h \
212     $$PWD/WebCoreSupport/PageClientQt.h \
213     $$PWD/WebCoreSupport/QtPlatformPlugin.h \
214     $$PWD/WebCoreSupport/PopupMenuQt.h \
215     $$PWD/WebCoreSupport/SearchPopupMenuQt.h \
216     $$PWD/WebCoreSupport/TextCheckerClientQt.h \
217     $$PWD/WebCoreSupport/WebPlatformStrategies.h
218
219 webkit2 {
220     HEADERS += $$WEBKIT2_API_HEADERS
221     SOURCES += $$WEBKIT2_API_SOURCES
222 }
223
224 contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
225     unix:!symbian {
226         maemo5 {
227             HEADERS += $$PWD/WebCoreSupport/QtMaemoWebPopup.h
228             SOURCES += $$PWD/WebCoreSupport/QtMaemoWebPopup.cpp
229         }
230     }
231 }
232
233 contains(DEFINES, ENABLE_VIDEO=1) {
234     !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
235         HEADERS += $$PWD/WebCoreSupport/FullScreenVideoWidget.h
236         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoWidget.cpp
237     }
238
239     contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
240         HEADERS += $$PWD/WebCoreSupport/FullScreenVideoQt.h
241         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoQt.cpp
242     }
243
244     contains(DEFINES, WTF_USE_QTKIT=1) {
245         INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/qt/ \
246                        $$SOURCE_DIR/WebCore/platform/mac/ \
247                        $$SOURCE_DIR/../WebKitLibraries/
248
249         DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
250
251         HEADERS += $$PWD/WebCoreSupport/WebSystemInterface.h \
252                    $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.h
253
254         OBJECTIVE_SOURCES += $$PWD/WebCoreSupport/WebSystemInterface.mm \
255                    $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.mm
256
257         LIBS+= -framework Security -framework IOKit
258         # We can know the Mac OS version by using the Darwin major version
259         DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
260         DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
261         equals(DARWIN_MAJOR_VERSION, "11") {
262             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a
263         } else:equals(DARWIN_MAJOR_VERSION, "10") {
264             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
265         } else:equals(DARWIN_MAJOR_VERSION, "9") {
266             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.a
267         }
268     }
269 }
270
271 contains(DEFINES, ENABLE_ICONDATABASE=1) {
272     HEADERS += \
273         $$SOURCE_DIR/WebCore/loader/icon/IconDatabaseClient.h \
274         $$PWD/WebCoreSupport/IconDatabaseClientQt.h
275
276     SOURCES += \
277         $$PWD/WebCoreSupport/IconDatabaseClientQt.cpp
278 }
279
280 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
281     HEADERS += \
282         $$PWD/WebCoreSupport/DeviceMotionClientQt.h \
283         $$PWD/WebCoreSupport/DeviceMotionProviderQt.h \
284         $$PWD/WebCoreSupport/DeviceOrientationClientQt.h \
285         $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.h \
286         $$PWD/WebCoreSupport/DeviceOrientationProviderQt.h
287
288     SOURCES += \
289         $$PWD/WebCoreSupport/DeviceMotionClientQt.cpp \
290         $$PWD/WebCoreSupport/DeviceMotionProviderQt.cpp \
291         $$PWD/WebCoreSupport/DeviceOrientationClientQt.cpp \
292         $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.cpp \
293         $$PWD/WebCoreSupport/DeviceOrientationProviderQt.cpp
294 }
295
296 contains(DEFINES, ENABLE_GEOLOCATION=1) {
297      HEADERS += \
298         $$PWD/WebCoreSupport/GeolocationClientQt.h
299      SOURCES += \
300         $$PWD/WebCoreSupport/GeolocationClientQt.cpp
301 }
302
303 contains(CONFIG, texmap) {
304     DEFINES += WTF_USE_TEXTURE_MAPPER=1
305 }
306
307 !symbian-abld:!symbian-sbsv2 {
308     modfile.files = $$moduleFile
309     modfile.path = $$[QMAKE_MKSPECS]/modules
310
311     INSTALLS += modfile
312 } else {
313     # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
314
315     inst_modfile.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
316     inst_modfile.input = moduleFile
317     inst_modfile.output = $$[QMAKE_MKSPECS]/modules
318     inst_modfile.CONFIG = no_clean
319
320     QMAKE_EXTRA_COMPILERS += inst_modfile
321
322     install.depends += compiler_inst_modfile_make_all
323     QMAKE_EXTRA_TARGETS += install
324 }
325
326 !CONFIG(QTDIR_build) {
327     exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
328     WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
329
330     !symbian-abld:!symbian-sbsv2 {
331         headers.files = $$WEBKIT_INSTALL_HEADERS
332
333         !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/QtWebKit
334         else: headers.path = $$[QT_INSTALL_HEADERS]/QtWebKit
335
336         !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
337         else: target.path = $$[QT_INSTALL_LIBS]
338
339         INSTALLS += target headers
340     } else {
341         # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
342         inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
343         inst_headers.input = WEBKIT_INSTALL_HEADERS
344         inst_headers.CONFIG = no_clean no_link target_predeps
345
346         !isEmpty(INSTALL_HEADERS): inst_headers.output = $$INSTALL_HEADERS/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
347         else: inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
348
349         QMAKE_EXTRA_COMPILERS += inst_headers
350
351         install.depends += compiler_inst_headers_make_all
352     }
353
354     unix {
355         CONFIG += create_pc create_prl
356         QMAKE_PKGCONFIG_LIBDIR = $$target.path
357         QMAKE_PKGCONFIG_INCDIR = $$headers.path
358         QMAKE_PKGCONFIG_DESTDIR = pkgconfig
359         lib_replace.match = $$re_escape($$DESTDIR)
360         lib_replace.replace = $$[QT_INSTALL_LIBS]
361         QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
362     }
363
364     mac {
365         !static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
366             !build_pass {
367                 message("Building QtWebKit as a framework, as that's how Qt was built. You can")
368                 message("override this by passing CONFIG+=webkit_no_framework to build-webkit.")
369
370                 CONFIG += build_all
371             } else {
372                 isEmpty(QT_SOURCE_TREE):debug_and_release:TARGET = $$qtLibraryTarget($$TARGET)
373             }
374
375             CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
376             FRAMEWORK_HEADERS.version = Versions
377             FRAMEWORK_HEADERS.files = $${headers.files}
378             FRAMEWORK_HEADERS.path = Headers
379             QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
380         }
381
382         QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
383     }
384 }
385
386 symbian {
387     shared {
388         contains(CONFIG, def_files) {
389             DEF_FILE=symbian
390             # defFilePath is for Qt4.6 compatibility
391             defFilePath=symbian
392         } else {
393             MMP_RULES += EXPORTUNFROZEN
394         }
395     }
396 }