[Qt] Replace use of QApplication with QGuiApplication
[WebKit-https.git] / Source / api.pri
1 # -------------------------------------------------------------------
2 # Project file for the QtWebKit C++ APIs
3 #
4 # See 'Tools/qmake/README' for an overview of the build system
5 # -------------------------------------------------------------------
6
7 TEMPLATE = lib
8 TARGET = QtWebKit
9
10 DESTDIR = $${ROOT_BUILD_DIR}/lib
11
12 load(features)
13
14 include(WebKit/WebKit.pri)
15
16 !v8:CONFIG += javascriptcore
17
18 CONFIG += webcore
19
20 !no_webkit2: include(WebKit2/WebKit2.pri)
21
22 v8:linux-* {
23     QMAKE_LIBDIR += $${V8_LIB_DIR}
24     LIBS = -lv8 $$LIBS
25 }
26
27 QT += network
28 haveQt(5): QT += widgets printsupport
29
30 win32*:!win32-msvc* {
31     # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
32     contains(DEFINES, ENABLE_WEBGL=1)|contains(CONFIG, texmap): LIBS += $$QMAKE_LIBS_OPENGL
33 }
34
35 CONFIG(release) {
36     contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
37     unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
38 }
39
40 MODULE_FILE = $${ROOT_WEBKIT_DIR}/Tools/qmake/qt_webkit.pri
41 include($${MODULE_FILE})
42 VERSION = $${QT.webkit.MAJOR_VERSION}.$${QT.webkit.MINOR_VERSION}.$${QT.webkit.PATCH_VERSION}
43
44 !static: DEFINES += QT_MAKEDLL
45
46 SOURCES += \
47     $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp \
48     $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.cpp \
49     $$PWD/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp \
50     $$PWD/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp \
51     $$PWD/WebKit/qt/WebCoreSupport/DragClientQt.cpp \
52     $$PWD/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
53     $$PWD/WebKit/qt/WebCoreSupport/EditorClientQt.cpp \
54     $$PWD/WebKit/qt/WebCoreSupport/EditCommandQt.cpp \
55     $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
56     $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \
57     $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \
58     $$PWD/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
59     $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp \
60     $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
61     $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.cpp \
62     $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp \
63     $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp \
64     $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp \
65     $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.cpp \
66     $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp
67
68 HEADERS += \
69     $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.h \
70     $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
71     $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.h \
72     $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
73     $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h \
74     $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h \
75     $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
76     $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.h \
77     $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h \
78     $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.h \
79     $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h \
80     $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.h \
81     $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.h
82
83 contains(DEFINES, ENABLE_VIDEO=1) {
84     !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
85         HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
86         SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp
87     }
88
89     contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
90         HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
91         SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
92     }
93
94     contains(DEFINES, WTF_USE_QTKIT=1) {
95         INCLUDEPATH += \
96             $$PWD/WebCore/platform/qt/ \
97             $$PWD/WebCore/platform/mac/ \
98             $$PWD/../WebKitLibraries/
99
100         DEFINES += NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
101
102         contains(CONFIG, "x86") {
103             DEFINES+=NS_BUILD_32_LIKE_64
104         }
105
106         HEADERS += \
107             $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.h \
108             $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h
109
110         OBJECTIVE_SOURCES += \
111             $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.mm \
112             $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm
113
114         LIBS += -framework Security -framework IOKit
115
116         # We can know the Mac OS version by using the Darwin major version
117         DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
118         DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
119         equals(DARWIN_MAJOR_VERSION, "11") {
120             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a
121         } else:equals(DARWIN_MAJOR_VERSION, "10") {
122             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
123         } else:equals(DARWIN_MAJOR_VERSION, "9") {
124             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
125         }
126     }
127 }
128
129 contains(DEFINES, ENABLE_ICONDATABASE=1) {
130     HEADERS += \
131         $$PWD/WebCore/loader/icon/IconDatabaseClient.h \
132         $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h
133
134     SOURCES += \
135         $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.cpp
136 }
137
138 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
139     HEADERS += \
140         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h \
141         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h \
142         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h \
143         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h \
144         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h
145
146     SOURCES += \
147         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp \
148         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp \
149         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp \
150         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp \
151         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp
152 }
153
154 contains(DEFINES, ENABLE_GEOLOCATION=1) {
155      haveQt(5): QT += location
156
157      HEADERS += \
158         $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
159      SOURCES += \
160         $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
161 }
162
163 contains(CONFIG, texmap) {
164     DEFINES += WTF_USE_TEXTURE_MAPPER=1
165 }
166
167 modulefile.files = $${MODULE_FILE}
168 mkspecs = $$[QMAKE_MKSPECS]
169 mkspecs = $$split(mkspecs, :)
170 modulefile.path = $$last(mkspecs)/modules
171 INSTALLS += modulefile
172
173 headers.files = $${ROOT_BUILD_DIR}/include/$${TARGET}/*
174 !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}
175 else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}
176 INSTALLS += headers
177
178 !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
179 else: target.path = $$[QT_INSTALL_LIBS]
180 INSTALLS += target
181
182 unix {
183     CONFIG += create_pc create_prl
184     QMAKE_PKGCONFIG_LIBDIR = $$target.path
185     QMAKE_PKGCONFIG_INCDIR = $$headers.path
186     QMAKE_PKGCONFIG_DESTDIR = pkgconfig
187     lib_replace.match = $$re_escape($$DESTDIR)
188     lib_replace.replace = $$[QT_INSTALL_LIBS]
189     QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
190 }
191
192 mac {
193     !static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
194         !build_pass {
195             message("Building QtWebKit as a framework, as that's how Qt was built. You can")
196             message("override this by passing CONFIG+=webkit_no_framework to build-webkit.")
197         } else {
198             isEmpty(QT_SOURCE_TREE):debug_and_release:TARGET = $$qtLibraryTarget($$TARGET)
199         }
200
201         CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
202         FRAMEWORK_HEADERS.version = Versions
203         FRAMEWORK_HEADERS.files = $$files($$headers.files, false)
204         FRAMEWORK_HEADERS.path = Headers
205         QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
206     }
207
208     QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
209 }
210