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