159b97bcdb6b80dc8c2d87b2e4f6f70a547bd9f5
[WebKit.git] / Source / widgetsapi.pri
1 # -------------------------------------------------------------------
2 # Target file for the QtWebKitWidgets dynamic library
3 #
4 # See 'Tools/qmake/README' for an overview of the build system
5 # -------------------------------------------------------------------
6
7 # Use Qt5's module system
8 load(qt_build_config)
9
10 TEMPLATE = lib
11 TARGET = QtWebKitWidgets
12
13 WEBKIT_DESTDIR = $${ROOT_BUILD_DIR}/lib
14
15 SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebKit
16
17 INCLUDEPATH += \
18     $$SOURCE_DIR/qt/Api \
19     $$SOURCE_DIR/qt/WidgetApi \
20     $$SOURCE_DIR/qt/WebCoreSupport \
21     $$SOURCE_DIR/qt/WidgetSupport \
22     $$ROOT_WEBKIT_DIR/Source/WTF/wtf/qt
23
24 enable?(DEVICE_ORIENTATION)|enable?(ORIENTATION_EVENTS) {
25     QT += sensors
26 }
27
28 enable?(GEOLOCATION): QT += location
29
30 use?(QT_MULTIMEDIA): QT *= multimediawidgets
31
32 contains(CONFIG, texmap): DEFINES += WTF_USE_TEXTURE_MAPPER=1
33
34 use?(PLUGIN_BACKEND_XLIB): PKGCONFIG += x11
35
36 QT += network widgets
37 have?(QTQUICK): QT += quick
38 have?(QTPRINTSUPPORT): QT += printsupport
39
40 use?(TEXTURE_MAPPER_GL)|enable?(WEBGL) {
41     QT *= opengl
42 }
43 QT += webkit
44
45 use?(3D_GRAPHICS): WEBKIT += ANGLE
46
47 WEBKIT += javascriptcore wtf webcore
48
49 MODULE = webkitwidgets
50
51 # We want the QtWebKit API forwarding includes to live in the root build dir.
52 MODULE_BASE_DIR = $$_PRO_FILE_PWD_
53 MODULE_BASE_OUTDIR = $$ROOT_BUILD_DIR
54
55 # This is the canonical list of dependencies for the public API of
56 # the QtWebKitWidgets library, and will end up in the library's prl file.
57 QT_API_DEPENDS = core gui widgets network webkit
58
59 # ---------------- Custom developer-build handling -------------------
60 #
61 # The assumption for Qt developer builds is that the module file
62 # will be put into qtbase/mkspecs/modules, and the libraries into
63 # qtbase/lib, with rpath/install_name set to the Qt lib dir.
64 #
65 # For WebKit we don't want that behavior for the libraries, as we want
66 # them to be self-contained in the WebKit build dir.
67 #
68 !production_build: CONFIG += force_independent
69
70 BASE_TARGET = $$TARGET
71
72 load(qt_module)
73
74 # Allow doing a debug-only build of WebKit (not supported by Qt)
75 macx:!debug_and_release:debug: TARGET = $$BASE_TARGET
76
77 # Make sure the install_name of the QtWebKit library point to webkit
78 force_independent:macx {
79     # We do our own absolute path so that we can trick qmake into
80     # using the webkit build path instead of the Qt install path.
81     CONFIG -= absolute_library_soname
82     QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/
83
84     !debug_and_release|build_pass {
85         # We also have to make sure the install_name is correct when
86         # the library is installed.
87         change_install_name.depends = install_target
88
89         # The install rules generated by qmake for frameworks are busted in
90         # that both the debug and the release makefile copy QtWebKit.framework
91         # into the install dir, so whatever changes we did to the release library
92         # will get overwritten when the debug library is installed. We work around
93         # that by running install_name on both, for both configs.
94         change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \
95             for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \
96                 install_name_tool -id \$\$file \$\$file; \
97             done
98         default_install_target.target = install
99         default_install_target.depends += change_install_name
100
101         QMAKE_EXTRA_TARGETS += change_install_name default_install_target
102     }
103 }
104
105 SOURCES += \
106     $$PWD/WebKit/qt/WidgetApi/qgraphicswebview.cpp \
107     $$PWD/WebKit/qt/WidgetApi/qwebframe.cpp \
108     $$PWD/WebKit/qt/WidgetApi/qwebpage.cpp \
109     $$PWD/WebKit/qt/WidgetApi/qwebview.cpp \
110     $$PWD/WebKit/qt/WidgetApi/qwebinspector.cpp \
111     $$PWD/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp \
112     $$PWD/WebKit/qt/WidgetSupport/QtWebComboBox.cpp \
113     $$PWD/WebKit/qt/WidgetSupport/QWebUndoCommand.cpp \
114     $$PWD/WebKit/qt/WidgetSupport/DefaultFullScreenVideoHandler.cpp \
115     $$PWD/WebKit/qt/WidgetSupport/InitWebKitQt.cpp \
116     $$PWD/WebKit/qt/WidgetSupport/InspectorClientWebPage.cpp \
117     $$PWD/WebKit/qt/WidgetSupport/PageClientQt.cpp \
118     $$PWD/WebKit/qt/WidgetSupport/QStyleFacadeImp.cpp \
119     $$PWD/WebKit/qt/WidgetSupport/QGraphicsWidgetPluginImpl.cpp \
120     $$PWD/WebKit/qt/WidgetSupport/QWidgetPluginImpl.cpp
121
122 HEADERS += \
123     $$PWD/WebKit/qt/WidgetApi/qgraphicswebview.h \
124     $$PWD/WebKit/qt/WidgetApi/qwebframe.h \
125     $$PWD/WebKit/qt/WidgetApi/qwebframe_p.h \
126     $$PWD/WebKit/qt/WidgetApi/qwebpage.h \
127     $$PWD/WebKit/qt/WidgetApi/qwebpage_p.h \
128     $$PWD/WebKit/qt/WidgetApi/qwebview.h \
129     $$PWD/WebKit/qt/WidgetApi/qwebinspector.h \
130     $$PWD/WebKit/qt/WidgetApi/qwebinspector_p.h \
131     $$PWD/WebKit/qt/Api/qwebkitplatformplugin.h \
132     $$PWD/WebKit/qt/WidgetSupport/InitWebKitQt.h \
133     $$PWD/WebKit/qt/WidgetSupport/InspectorClientWebPage.h \
134     $$PWD/WebKit/qt/WidgetSupport/DefaultFullScreenVideoHandler.h \
135     $$PWD/WebKit/qt/WidgetSupport/QtFallbackWebPopup.h \
136     $$PWD/WebKit/qt/WidgetSupport/QtWebComboBox.h \
137     $$PWD/WebKit/qt/WidgetSupport/QWebUndoCommand.h \
138     $$PWD/WebKit/qt/WidgetSupport/PageClientQt.h \
139     $$PWD/WebKit/qt/WidgetSupport/QGraphicsWidgetPluginImpl.h \
140     $$PWD/WebKit/qt/WidgetSupport/QStyleFacadeImp.h \
141     $$PWD/WebKit/qt/WidgetSupport/QWidgetPluginImpl.h \
142
143 contains(QT_CONFIG, accessibility) {
144     SOURCES += $$PWD/WebKit/qt/WidgetApi/qwebviewaccessible.cpp
145     HEADERS += $$PWD/WebKit/qt/WidgetApi/qwebviewaccessible_p.h 
146 }
147
148 INCLUDEPATH += \
149     $$PWD/qt/Api \
150     $$PWD/qt/WebCoreSupport
151
152 enable?(VIDEO) {
153     !use?(QTKIT):!use?(GSTREAMER):use?(QT_MULTIMEDIA) {
154         HEADERS += $$PWD/WebKit/qt/WidgetSupport/FullScreenVideoWidget.h
155         SOURCES += $$PWD/WebKit/qt/WidgetSupport/FullScreenVideoWidget.cpp
156     }
157 }
158