5da316b59a2daa08a5a85252ea678e045cb83be1
[WebKit-https.git] / Source / WebKit / PlatformBlackBerry.cmake
1 list(INSERT WebKit_INCLUDE_DIRECTORIES 0
2     "${BLACKBERRY_THIRD_PARTY_DIR}" # For <unicode.h>, which is included from <sys/keycodes.h>.
3 )
4
5 list(APPEND WebKit_INCLUDE_DIRECTORIES
6     "${JAVASCRIPTCORE_DIR}/dfg"
7     "${WEBCORE_DIR}/bindings/cpp"
8     "${WEBCORE_DIR}/fileapi"
9     "${WEBCORE_DIR}/history/blackberry"
10     "${WEBCORE_DIR}/html/parser" # For HTMLParserIdioms.h
11     "${WEBCORE_DIR}/loader/appcache"
12     "${WEBCORE_DIR}/platform/blackberry"
13     "${WEBCORE_DIR}/platform/graphics/gpu"
14     "${WEBCORE_DIR}/platform/graphics/blackberry"
15     "${WEBCORE_DIR}/platform/image-encoders"
16     "${WEBCORE_DIR}/platform/network/blackberry"
17     "${WEBCORE_DIR}/testing/js"
18     "${WEBCORE_DIR}/Modules/geolocation"
19     "${WEBCORE_DIR}/Modules/indexeddb"
20     "${WEBCORE_DIR}/Modules/vibration"
21     "${WEBCORE_DIR}/Modules/websockets"
22     "${WEBKIT_DIR}/blackberry/Api"
23     "${WEBKIT_DIR}/blackberry/WebCoreSupport"
24     "${WEBKIT_DIR}/blackberry/WebKitSupport"
25     "${CMAKE_SOURCE_DIR}"
26 )
27
28 if (ENABLE_NOTIFICATIONS)
29     list(APPEND WebKit_INCLUDE_DIRECTORIES
30         "${WEBCORE_DIR}/Modules/notifications"
31     )
32 endif ()
33
34 if (NOT PUBLIC_BUILD)
35     list(APPEND WebKit_INCLUDE_DIRECTORIES
36         # needed for DRT for now
37         "${WEBCORE_DIR}/platform/mock"
38         "${WEBCORE_DIR}/svg/animation"
39         "${WEBCORE_DIR}/workers"
40         "${TOOLS_DIR}"
41         "${TOOLS_DIR}/DumpRenderTree"
42         "${TOOLS_DIR}/DumpRenderTree/blackberry"
43     )
44 endif ()
45
46 if (ENABLE_BATTERY_STATUS)
47     list(APPEND WebKit_INCLUDE_DIRECTORIES ${WEBCORE_DIR}/Modules/battery)
48     list(APPEND WebKit_SOURCES blackberry/WebCoreSupport/BatteryClientBlackBerry.cpp)
49 endif ()
50
51 if (ENABLE_NAVIGATOR_CONTENT_UTILS)
52   list(APPEND WebKit_INCLUDE_DIRECTORIES
53     "${WEBCORE_DIR}/Modules/navigatorcontentutils"
54   )
55 endif ()
56
57 if (ENABLE_MEDIA_STREAM)
58     list(APPEND WebKit_INCLUDE_DIRECTORIES
59         "${WEBCORE_DIR}/Modules/mediastream"
60         "${WEBCORE_DIR}/platform/mediastream"
61     )
62     list(APPEND WebKit_SOURCES
63         blackberry/WebCoreSupport/UserMediaClientImpl.cpp
64     )
65 endif ()
66
67 add_definitions(-DUSER_PROCESSES)
68
69 list(APPEND WebKit_SOURCES
70     blackberry/Api/BackingStore.cpp
71     blackberry/Api/BlackBerryGlobal.cpp
72     blackberry/Api/InRegionScroller.cpp
73     blackberry/Api/JavaScriptVariant.cpp
74     blackberry/Api/WebAnimation.cpp
75     blackberry/Api/WebCookieJar.cpp
76     blackberry/Api/WebKitMIMETypeConverter.cpp
77     blackberry/Api/WebKitTextCodec.cpp
78     blackberry/Api/WebOverlay.cpp
79     blackberry/Api/WebOverlayOverride.cpp
80     blackberry/Api/WebPage.cpp
81     blackberry/Api/WebPageCompositor.cpp
82     blackberry/Api/WebPageGroupLoadDeferrer.cpp
83     blackberry/Api/WebSettings.cpp
84     blackberry/Api/WebViewportArguments.cpp
85
86     blackberry/WebCoreSupport/AutofillManager.cpp
87     blackberry/WebCoreSupport/BackForwardListBlackBerry.cpp
88     blackberry/WebCoreSupport/CacheClientBlackBerry.cpp
89     blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
90     blackberry/WebCoreSupport/CredentialManager.cpp
91     blackberry/WebCoreSupport/CredentialTransformData.cpp
92     blackberry/WebCoreSupport/DeviceMotionClientBlackBerry.cpp
93     blackberry/WebCoreSupport/DeviceOrientationClientBlackBerry.cpp
94     blackberry/WebCoreSupport/DragClientBlackBerry.cpp
95     blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
96     blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
97     blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp
98     blackberry/WebCoreSupport/GeolocationClientBlackBerry.cpp
99     blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp
100     blackberry/WebCoreSupport/InspectorClientBlackBerry.cpp
101     blackberry/WebCoreSupport/NavigatorContentUtilsClientBlackBerry.cpp
102     blackberry/WebCoreSupport/NetworkInfoClientBlackBerry.cpp
103     blackberry/WebCoreSupport/NotificationClientBlackBerry.cpp
104     blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.cpp
105     blackberry/WebCoreSupport/SuggestionBoxElement.cpp
106     blackberry/WebCoreSupport/SuggestionBoxHandler.cpp
107     blackberry/WebCoreSupport/VibrationClientBlackBerry.cpp
108
109     blackberry/WebKitSupport/AboutData.cpp
110     blackberry/WebKitSupport/BackingStoreClient.cpp
111     blackberry/WebKitSupport/BackingStoreTile.cpp
112     blackberry/WebKitSupport/BackingStoreVisualizationViewportAccessor.cpp
113     blackberry/WebKitSupport/ColorPickerClient.cpp
114     blackberry/WebKitSupport/DOMSupport.cpp
115     blackberry/WebKitSupport/DatePickerClient.cpp
116     blackberry/WebKitSupport/DefaultTapHighlight.cpp
117     blackberry/WebKitSupport/FatFingers.cpp
118     blackberry/WebKitSupport/FrameLayers.cpp
119     blackberry/WebKitSupport/InPageSearchManager.cpp
120     blackberry/WebKitSupport/InRegionScrollableArea.cpp
121     blackberry/WebKitSupport/InputHandler.cpp
122     blackberry/WebKitSupport/InspectorOverlayBlackBerry.cpp
123     blackberry/WebKitSupport/NotificationManager.cpp
124     blackberry/WebKitSupport/PagePopup.cpp
125     blackberry/WebKitSupport/PagePopupClient.cpp
126     blackberry/WebKitSupport/ProximityDetector.cpp
127     blackberry/WebKitSupport/RenderQueue.cpp
128     blackberry/WebKitSupport/SelectPopupClient.cpp
129     blackberry/WebKitSupport/SelectionHandler.cpp
130     blackberry/WebKitSupport/SelectionOverlay.cpp
131     blackberry/WebKitSupport/SpellingHandler.cpp
132     blackberry/WebKitSupport/SurfacePool.cpp
133     blackberry/WebKitSupport/TouchEventHandler.cpp
134     blackberry/WebKitSupport/WebKitThreadViewportAccessor.cpp
135 )
136
137 if (ENABLE_WEBGL)
138     add_definitions(-DWTF_USE_OPENGL_ES_2=1)
139     list(APPEND WebKit_INCLUDE_DIRECTORIES
140         ${OPENGL_INCLUDE_DIR}
141         ${THIRDPARTY_DIR}/ANGLE/src
142         ${THIRDPARTY_DIR}/ANGLE/include/GLSLANG
143     )
144     list(APPEND WebKit_LIBRARIES
145         ${OPENGL_gl_LIBRARY}
146     )
147 endif (ENABLE_WEBGL)
148
149 if (NOT PUBLIC_BUILD)
150     # DumpRenderTree sources
151     list(APPEND WebKit_SOURCES
152         ${TOOLS_DIR}/DumpRenderTree/AccessibilityController.cpp
153         ${TOOLS_DIR}/DumpRenderTree/AccessibilityTextMarker.cpp
154         ${TOOLS_DIR}/DumpRenderTree/AccessibilityUIElement.cpp
155         ${TOOLS_DIR}/DumpRenderTree/CyclicRedundancyCheck.cpp
156         ${TOOLS_DIR}/DumpRenderTree/GCController.cpp
157         ${TOOLS_DIR}/DumpRenderTree/PixelDumpSupport.cpp
158         ${TOOLS_DIR}/DumpRenderTree/TestRunner.cpp
159         ${TOOLS_DIR}/DumpRenderTree/WorkQueue.cpp
160
161         ${TOOLS_DIR}/DumpRenderTree/blackberry/AccessibilityControllerBlackBerry.cpp
162         ${TOOLS_DIR}/DumpRenderTree/blackberry/AccessibilityUIElementBlackBerry.cpp
163         ${TOOLS_DIR}/DumpRenderTree/blackberry/DumpRenderTree.cpp
164         ${TOOLS_DIR}/DumpRenderTree/blackberry/EventSender.cpp
165         ${TOOLS_DIR}/DumpRenderTree/blackberry/GCControllerBlackBerry.cpp
166         ${TOOLS_DIR}/DumpRenderTree/blackberry/PNGImageEncoder.cpp
167         ${TOOLS_DIR}/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.cpp
168         ${TOOLS_DIR}/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp
169         ${TOOLS_DIR}/DumpRenderTree/blackberry/WorkQueueItemBlackBerry.cpp
170
171         ${WTF_DIR}/wtf/MD5.cpp
172
173         blackberry/WebKitSupport/DumpRenderTreeSupport.cpp
174     )
175 endif ()
176
177 set(WebKit_LINK_FLAGS ${BLACKBERRY_LINK_FLAGS})
178
179 list(APPEND WebKit_LIBRARIES
180     ${CURL_LIBRARY}
181     ${FONTCONFIG_LIBRARY}
182     ${ICUData_LIBRARY}
183     ${ICUI18N_LIBRARY}
184     ${ICUUC_LIBRARY}
185     ${INTL_LIBRARY}
186     ${ITYPE_LIBRARY}
187     ${JPEG_LIBRARY}
188     ${LEVELDB_LIBRARY}
189     ${MMR_LIBRARY}
190     ${M_LIBRARY}
191     ${OTS_LIBRARY}
192     ${PNG_LIBRARY}
193     ${SQLITE3_LIBRARY}
194     ${WTLE_LIBRARY}
195     ${WebKitPlatform_LIBRARY}
196     ${XML2_LIBRARY}
197     ${XSLT_LIBRARY}
198     ${Z_LIBRARY}
199     JavaScriptCore
200 )
201
202 if (PROFILING)
203     list(APPEND WebKit_LIBRARIES
204         ${PROFILING_LIBRARY}
205     )
206 endif ()
207
208 if (WTF_USE_ACCELERATED_COMPOSITING)
209     list(APPEND WebKit_SOURCES
210         blackberry/WebKitSupport/GLES2Context.cpp
211     )
212     list(APPEND WebKit_INCLUDE_DIRECTORIES
213         "${WEBCORE_DIR}/platform/graphics/gles2"
214     )
215     list(APPEND WebKit_LIBRARIES
216         ${EGL_LIBRARY}
217         ${GLESv2_LIBRARY}
218     )
219 endif ()
220
221 file(GLOB BBWebKit_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/blackberry/Api/*.h")
222
223 install(FILES ${BBWebKit_HEADERS}
224         DESTINATION ../../usr/include/browser/webkit)
225
226 if (NOT PUBLIC_BUILD)
227     install(FILES ${TOOLS_DIR}/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h
228             DESTINATION ../../usr/include/browser/webkit)
229 endif ()
230
231 if (ENABLE_VIDEO_TRACK)
232     list(APPEND WebKit_INCLUDE_DIRECTORIES
233         "${WEBCORE_DIR}/html/track"
234     )
235 endif ()
236
237 install(DIRECTORY ${WEBCORE_DIR}/inspector/front-end/
238         DESTINATION ../../usr/share/webkit/inspector/
239         FILES_MATCHING PATTERN "*.js")
240 install(DIRECTORY ${WEBCORE_DIR}/inspector/front-end/
241         DESTINATION ../../usr/share/webkit/inspector/
242         FILES_MATCHING PATTERN "*.css")
243 install(DIRECTORY ${WEBCORE_DIR}/inspector/front-end/
244         DESTINATION ../../usr/share/webkit/inspector/
245         FILES_MATCHING PATTERN "*.png")
246 install(DIRECTORY ${WEBCORE_DIR}/inspector/front-end/
247         DESTINATION ../../usr/share/webkit/inspector/
248         FILES_MATCHING PATTERN "*.jpg")
249 install(DIRECTORY ${WEBCORE_DIR}/inspector/front-end/
250         DESTINATION ../../usr/share/webkit/inspector/
251         FILES_MATCHING PATTERN "*.gif")
252 install(FILES ${DERIVED_SOURCES_WEBCORE_DIR}/inspectorBB.html
253               ${WEBKIT_DIR}/blackberry/WebCoreSupport/inspectorBB.js
254               ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorBackendCommands.js
255         DESTINATION ../../usr/share/webkit/inspector/)
256
257 if (NOT PUBLIC_BUILD)
258     # Add the custom target to build the host-side ImageDiff binary.
259     # Reuse the Qt version.
260     add_custom_target(
261         ImageDiff ALL
262         WORKING_DIRECTORY ${TOOLS_DIR}/DumpRenderTree/blackberry/
263         COMMAND ./build
264         DEPENDS ${TOOLS_DIR}/DumpRenderTree/qt/ImageDiff.cpp
265         COMMENT "ImageDiff building..."
266     )
267 endif ()
268
269 add_custom_target(
270     inspector ALL
271     command cp ${WEBCORE_DIR}/inspector/front-end/inspector.html ${DERIVED_SOURCES_WEBCORE_DIR}/inspectorBB.html && echo '<script src="inspectorBB.js"></script>'  >> ${DERIVED_SOURCES_WEBCORE_DIR}/inspectorBB.html
272     DEPENDS WebCore
273     COMMENT "Web Inspector resources building..."
274 )
275
276 # Generate contents for AboutData.cpp
277 add_custom_command(
278     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/AboutDataHaveFeatures.cpp
279     MAIN_DEPENDENCY ${WEBKIT_DIR}/blackberry/WebCoreSupport/AboutDataHaveFeatures.in
280     DEPENDS ${WEBKIT_DIR}/blackberry/WebCoreSupport/AboutDataHaveFeatures.in ${WEBKIT_DIR}/blackberry/WebCoreSupport/generateAboutDataFeatures.pl
281     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/blackberry/WebCoreSupport/generateAboutDataFeatures.pl HAVE ${WEBKIT_DIR}/blackberry/WebCoreSupport/AboutDataHaveFeatures.in ${DERIVED_SOURCES_WEBCORE_DIR}/AboutDataHaveFeatures.cpp
282 )
283
284 add_custom_command(
285     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/AboutDataEnableFeatures.cpp
286     MAIN_DEPENDENCY ${WEBKIT_DIR}/blackberry/WebCoreSupport/AboutDataEnableFeatures.in
287     DEPENDS ${WEBKIT_DIR}/blackberry/WebCoreSupport/AboutDataEnableFeatures.in ${WEBKIT_DIR}/blackberry/WebCoreSupport/generateAboutDataFeatures.pl
288     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/blackberry/WebCoreSupport/generateAboutDataFeatures.pl ENABLE ${WEBKIT_DIR}/blackberry/WebCoreSupport/AboutDataEnableFeatures.in ${DERIVED_SOURCES_WEBCORE_DIR}/AboutDataEnableFeatures.cpp
289 )
290
291 add_custom_command(
292     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/AboutDataUseFeatures.cpp
293     MAIN_DEPENDENCY ${WEBKIT_DIR}/blackberry/WebCoreSupport/AboutDataUseFeatures.in
294     DEPENDS ${WEBKIT_DIR}/blackberry/WebCoreSupport/AboutDataUseFeatures.in ${WEBKIT_DIR}/blackberry/WebCoreSupport/generateAboutDataFeatures.pl
295     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/blackberry/WebCoreSupport/generateAboutDataFeatures.pl USE ${WEBKIT_DIR}/blackberry/WebCoreSupport/AboutDataUseFeatures.in ${DERIVED_SOURCES_WEBCORE_DIR}/AboutDataUseFeatures.cpp
296 )
297
298 add_custom_target(
299     aboutFeatures ALL
300     DEPENDS ${DERIVED_SOURCES_WEBCORE_DIR}/AboutDataHaveFeatures.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/AboutDataEnableFeatures.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/AboutDataUseFeatures.cpp
301 )