1 # -------------------------------------------------------------------
2 # Project file for the QtWebKit C++ APIs
4 # See 'Tools/qmake/README' for an overview of the build system
5 # -------------------------------------------------------------------
10 WEBKIT_DESTDIR = $${ROOT_BUILD_DIR}/lib
13 # Use Qt5's module system
16 MODULE_PRI = $$QT.webkit.module_pri
19 BASE_TARGET = $$TARGET
21 load(qt_module_config)
23 # Make sure the module config doesn't override our preferred build config
24 debug_and_release:if(!debug|!release): CONFIG -= debug_and_release
26 # Allow doing a debug-only build of WebKit (not supported by Qt)
27 macx:!debug_and_release:debug: TARGET = $$BASE_TARGET
29 # ---------------- Custom developer-build handling -------------------
31 # The assumption for Qt developer builds is that the module file
32 # will be put into qtbase/mkspecs/modules, and the libraries into
33 # qtbase/lib, with rpath/install_name set to the Qt lib dir.
35 # For WebKit we don't want that behavior for the libraries, as we want
36 # them to be self-contained in the WebKit build dir. To achive that we
37 # trick Qt into thinking it's not a developer build, but setting QTDIR
38 # to a bogus path in default_pre.prf.
40 # We still want the module file to live in the Qt dir so the module can
41 # be used by setting QT += webkit, so we copy the file manually. We also
42 # have to make sure the rpath/install_name of the libraries are relative
43 # to the webkit build dir.
45 # We use private_tests to detect developer build, since the destdir will
46 # always be our webkit build dir. This might change as configure changes.
47 contains(QT_CONFIG, private_tests): CONFIG += qt_developer_build
50 # Make a more accessible copy of the module forward file
51 # in the WebKit build directory.
52 convenience_module_path = $${ROOT_BUILD_DIR}/modules
53 module_filename = $$basename(QT.webkit.module_pri)
55 # The QMAKE_EXTRA_MODULE_FORWARDS might contain more than one path,
56 # so we iterate the paths and find one that matches our build dir.
57 for(module_forward, QMAKE_EXTRA_MODULE_FORWARDS) {
58 in_build_dir = $$find(module_forward, ^$${ROOT_BUILD_DIR})
59 !isEmpty(in_build_dir) {
60 webkit_module_forward = $$module_forward
65 isEmpty(webkit_module_forward) {
66 warning(Could not resolve QMAKE_EXTRA_MODULE_FORWARDS path!)
68 make_module_fwd_convenience.target = $$convenience_module_path/$$module_filename
69 make_module_fwd_convenience.commands = $$QMAKE_MKDIR $$convenience_module_path \
70 && echo \"include($$webkit_module_forward/$$module_filename)\" > $$convenience_module_path/$$module_filename
71 make_module_fwd_convenience.depends = $$webkit_module_forward/$$module_filename
73 QMAKE_EXTRA_TARGETS += make_module_fwd_convenience
74 DEFAULT_TARGETS += make_module_fwd_convenience
78 # Copy the module forward file into Qt so that the module
79 # is immediately accessible.
80 qt_modules_path = $$[QT_INSTALL_PREFIX]/mkspecs/modules
82 copy_module_fwd_file.target = $$qt_modules_path/$$module_filename
83 copy_module_fwd_file.commands = $$QMAKE_COPY $$QMAKE_EXTRA_MODULE_FORWARDS/$$module_filename $$qt_modules_path
84 # FIXME: Add dependendy that ensures we copy the forward file if the target is updated
85 copy_module_fwd_file.depends = $$QMAKE_EXTRA_MODULE_FORWARDS/$$module_filename
87 QMAKE_EXTRA_TARGETS += copy_module_fwd_file
88 DEFAULT_TARGETS += copy_module_fwd_file
92 # Make sure the install_name of the QtWebKit library point to webkit
94 # We do our own absolute path so that we can trick qmake into
95 # using the webkit build path instead of the Qt install path.
96 CONFIG -= absolute_library_soname
97 QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/
99 !debug_and_release|build_pass {
100 # We also have to make sure the install_name is correct when
101 # the library is installed.
102 change_install_name.depends = install_target
104 # The install rules generated by qmake for frameworks are busted in
105 # that both the debug and the release makefile copy QtWebKit.framework
106 # into the install dir, so whatever changes we did to the release library
107 # will get overwritten when the debug library is installed. We work around
108 # that by running install_name on both, for both configs.
109 change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \
110 for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \
111 install_name_tool -id \$\$file \$\$file; \
113 default_install_target.target = install
114 default_install_target.depends += change_install_name
116 QMAKE_EXTRA_TARGETS += change_install_name default_install_target
120 VERSION = $$QT_VERSION
121 DESTDIR = $$WEBKIT_DESTDIR
124 runSyncQt() # Generate forwarding headers for the QtWebKit API
128 include(WebKit/WebKit.pri)
132 !v8:WEBKIT += javascriptcore
140 # Ensure that changes to the WebKit2 API will trigger a qmake of this
141 # file, which in turn runs syncqt to update the forwarding headers.
142 QMAKE_INTERNAL_INCLUDED_FILES *= WebKit2/Target.pri
146 haveQt(5): QT += widgets printsupport quick
148 contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1)|contains(DEFINES, ENABLE_WEBGL=1) {
150 # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
151 win32*:!win32-msvc*: LIBS += $$QMAKE_LIBS_OPENGL
154 !static: DEFINES += QT_MAKEDLL
157 $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp \
158 $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.cpp \
159 $$PWD/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp \
160 $$PWD/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp \
161 $$PWD/WebKit/qt/WebCoreSupport/DragClientQt.cpp \
162 $$PWD/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
163 $$PWD/WebKit/qt/WebCoreSupport/EditorClientQt.cpp \
164 $$PWD/WebKit/qt/WebCoreSupport/UndoStepQt.cpp \
165 $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
166 $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \
167 $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \
168 $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp \
169 $$PWD/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
170 $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp \
171 $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
172 $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.cpp \
173 $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp \
174 $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp \
175 $$PWD/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp \
176 $$PWD/WebKit/qt/WebCoreSupport/ScrollbarThemeQStyle.cpp \
177 $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp \
178 $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.cpp \
179 $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp \
180 $$PWD/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
183 $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.h \
184 $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.h \
185 $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
186 $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.h \
187 $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
188 $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h \
189 $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h \
190 $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
191 $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.h \
192 $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.h \
193 $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h \
194 $$PWD/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h \
195 $$PWD/WebKit/qt/WebCoreSupport/ScrollbarThemeQStyle.h \
196 $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h \
197 $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.h \
198 $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.h \
199 $$PWD/WebKit/qt/WebCoreSupport/WebEventConversion.h
202 $$PWD/WebKit/qt/Api \
203 $$PWD/WebKit/qt/WebCoreSupport \
206 contains(DEFINES, ENABLE_VIDEO=1) {
207 !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
208 HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
209 SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp
212 contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
213 HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
214 SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
217 contains(DEFINES, WTF_USE_QTKIT=1) {
219 $$PWD/WebCore/platform/qt/ \
220 $$PWD/WebCore/platform/mac/ \
221 $$PWD/../WebKitLibraries/
223 DEFINES += NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
225 contains(CONFIG, "x86") {
226 DEFINES+=NS_BUILD_32_LIKE_64
230 $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.h \
231 $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h
233 OBJECTIVE_SOURCES += \
234 $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.mm \
235 $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm
237 LIBS += -framework Security -framework IOKit
239 # We can know the Mac OS version by using the Darwin major version
240 DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
241 DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
242 equals(DARWIN_MAJOR_VERSION, "11") {
243 LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a
244 } else:equals(DARWIN_MAJOR_VERSION, "10") {
245 LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
246 } else:equals(DARWIN_MAJOR_VERSION, "9") {
247 LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
252 contains(DEFINES, ENABLE_ICONDATABASE=1) {
254 $$PWD/WebCore/loader/icon/IconDatabaseClient.h \
255 $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h
258 $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.cpp
261 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) || contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1) {
270 contains(DEFINES, ENABLE_GEOLOCATION=1) {
271 haveQt(5): QT += location
274 $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
276 $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
279 contains(CONFIG, texmap) {
280 DEFINES += WTF_USE_TEXTURE_MAPPER=1
283 plugin_backend_xlib: PKGCONFIG += x11
285 # ------------- Install rules -------------
288 # Install rules handled by Qt's module system
290 # For Qt4 we have to set up install rules manually
292 # Syncqt has already run at this point, so we can use headers.pri
293 # as a basis for our install-rules
294 HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$${QT.webkit.name}/headers.pri
295 !include($$HEADERS_PRI): error(Failed to resolve install headers)
297 headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
298 !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}
299 else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}
302 !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
303 else: target.path = $$[QT_INSTALL_LIBS]
307 CONFIG += create_pc create_prl
308 QMAKE_PKGCONFIG_LIBDIR = $$target.path
309 QMAKE_PKGCONFIG_INCDIR = $$headers.path
310 QMAKE_PKGCONFIG_DESTDIR = pkgconfig
311 lib_replace.match = $$re_escape($$DESTDIR)
312 lib_replace.replace = $$[QT_INSTALL_LIBS]
313 QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
317 !static:contains(QT_CONFIG, qt_framework) {
318 # Build QtWebKit as a framework, to match how Qt was built
319 CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
321 # For debug_and_release configs, only copy headers in release
322 !debug_and_release|if(build_pass:CONFIG(release, debug|release)) {
323 FRAMEWORK_HEADERS.version = Versions
324 FRAMEWORK_HEADERS.files = $${headers.files}
325 FRAMEWORK_HEADERS.path = Headers
326 QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
330 QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"