Compile DumpRenderTree with CMake on Mac
[WebKit-https.git] / Source / WebKit / PlatformMac.cmake
1 find_library(QUARTZ_LIBRARY Quartz)
2 add_definitions(-iframework ${QUARTZ_LIBRARY}/Frameworks)
3 link_directories(../../WebKitLibraries)
4
5 list(APPEND WebKit_INCLUDE_DIRECTORIES
6     "${DERIVED_SOURCES_DIR}"
7     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
8     "${DERIVED_SOURCES_WEBCORE_DIR}"
9     "${DERIVED_SOURCES_WEBKITLEGACY_DIR}"
10     "${JAVASCRIPTCORE_DIR}"
11     "${JAVASCRIPTCORE_DIR}/dfg"
12     "${WEBCORE_DIR}/accessibility/mac"
13     "${WEBCORE_DIR}/bindings/objc"
14     "${WEBCORE_DIR}/bridge"
15     "${WEBCORE_DIR}/bridge/jsc"
16     "${WEBCORE_DIR}/bridge/objc"
17     "${WEBCORE_DIR}/ForwardingHeaders/inspector"
18     "${WEBCORE_DIR}/loader/archive/cf"
19     "${WEBCORE_DIR}/loader/cf"
20     "${WEBCORE_DIR}/loader/mac"
21     "${WEBCORE_DIR}/page/cocoa"
22     "${WEBCORE_DIR}/page/mac"
23     "${WEBCORE_DIR}/platform/cf"
24     "${WEBCORE_DIR}/platform/cocoa"
25     "${WEBCORE_DIR}/platform/graphics/avfoundation"
26     "${WEBCORE_DIR}/platform/graphics/avfoundation/cf"
27     "${WEBCORE_DIR}/platform/graphics/avfoundation/objc"
28     "${WEBCORE_DIR}/platform/graphics/ca"
29     "${WEBCORE_DIR}/platform/graphics/ca/mac"
30     "${WEBCORE_DIR}/platform/graphics/cocoa"
31     "${WEBCORE_DIR}/platform/graphics/cg"
32     "${WEBCORE_DIR}/platform/graphics/opentype"
33     "${WEBCORE_DIR}/platform/graphics/mac"
34     "${WEBCORE_DIR}/platform/mac"
35     "${WEBCORE_DIR}/platform/network/cocoa"
36     "${WEBCORE_DIR}/platform/network/cf"
37     "${WEBCORE_DIR}/platform/network/mac"
38     "${WEBCORE_DIR}/platform/text/cf"
39     "${WEBCORE_DIR}/platform/text/mac"
40     "${WEBCORE_DIR}/plugins/mac"
41     "${WTF_DIR}"
42     ../../WebKitLibraries
43 )
44
45 list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
46     mac
47     mac/Carbon
48     mac/DefaultDelegates
49     mac/DOM
50     mac/History
51     mac/icu
52     mac/Misc
53     mac/Panels
54     mac/Plugins
55     mac/Plugins/Hosted
56     mac/Storage
57     mac/WebCoreSupport
58     mac/WebInspector
59     mac/WebView
60 )
61
62 list(APPEND WebKit_SOURCES
63     cf/WebCoreSupport/WebInspectorClientCF.cpp
64
65     mac/Carbon/CarbonUtils.m
66     mac/Carbon/CarbonWindowAdapter.mm
67     mac/Carbon/CarbonWindowContentView.m
68     mac/Carbon/CarbonWindowFrame.m
69     mac/Carbon/HIViewAdapter.m
70     mac/Carbon/HIWebView.mm
71
72     mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm
73     mac/DefaultDelegates/WebDefaultEditingDelegate.m
74     mac/DefaultDelegates/WebDefaultPolicyDelegate.m
75     mac/DefaultDelegates/WebDefaultUIDelegate.m
76
77     mac/History/BinaryPropertyList.cpp
78     mac/History/HistoryPropertyList.mm
79     mac/History/WebBackForwardList.mm
80     mac/History/WebHistory.mm
81     mac/History/WebHistoryItem.mm
82     mac/History/WebURLsWithTitles.m
83
84     mac/Misc/OldWebAssertions.c
85     mac/Misc/WebCache.mm
86     mac/Misc/WebCoreStatistics.mm
87     mac/Misc/WebDownload.mm
88     mac/Misc/WebElementDictionary.mm
89     mac/Misc/WebIconDatabase.mm
90     mac/Misc/WebKitErrors.m
91     mac/Misc/WebKitLogging.m
92     mac/Misc/WebKitNSStringExtras.mm
93     mac/Misc/WebKitStatistics.m
94     mac/Misc/WebKitVersionChecks.m
95     mac/Misc/WebLocalizableStrings.mm
96     mac/Misc/WebLocalizableStringsInternal.mm
97     mac/Misc/WebNSControlExtras.m
98     mac/Misc/WebNSDataExtras.m
99     mac/Misc/WebNSDictionaryExtras.m
100     mac/Misc/WebNSEventExtras.m
101     mac/Misc/WebNSFileManagerExtras.mm
102     mac/Misc/WebNSImageExtras.m
103     mac/Misc/WebNSObjectExtras.mm
104     mac/Misc/WebNSPasteboardExtras.mm
105     mac/Misc/WebNSPrintOperationExtras.m
106     mac/Misc/WebNSURLExtras.mm
107     mac/Misc/WebNSURLRequestExtras.m
108     mac/Misc/WebNSUserDefaultsExtras.mm
109     mac/Misc/WebNSViewExtras.m
110     mac/Misc/WebNSWindowExtras.m
111     mac/Misc/WebSharingServicePickerController.mm
112     mac/Misc/WebStringTruncator.mm
113     mac/Misc/WebUserContentURLPattern.mm
114
115     mac/Panels/WebAuthenticationPanel.m
116     mac/Panels/WebPanelAuthenticationHandler.m
117
118     mac/Plugins/WebBaseNetscapePluginView.mm
119     mac/Plugins/WebBasePluginPackage.mm
120     mac/Plugins/WebNetscapeContainerCheckContextInfo.mm
121     mac/Plugins/WebNetscapeContainerCheckPrivate.mm
122     mac/Plugins/WebNetscapePluginEventHandler.mm
123     mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
124     mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
125     mac/Plugins/WebNetscapePluginPackage.mm
126     mac/Plugins/WebNetscapePluginStream.mm
127     mac/Plugins/WebNetscapePluginView.mm
128     mac/Plugins/WebPluginContainerCheck.mm
129     mac/Plugins/WebPluginController.mm
130     mac/Plugins/WebPluginDatabase.mm
131     mac/Plugins/WebPluginPackage.mm
132     mac/Plugins/WebPluginRequest.m
133     mac/Plugins/npapi.mm
134
135     mac/Plugins/Hosted/HostedNetscapePluginStream.mm
136     mac/Plugins/Hosted/NetscapePluginHostManager.mm
137     mac/Plugins/Hosted/NetscapePluginHostProxy.mm
138     mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
139     mac/Plugins/Hosted/ProxyInstance.mm
140     mac/Plugins/Hosted/ProxyRuntimeObject.mm
141     mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
142     mac/Plugins/Hosted/WebKitPluginAgent.defs
143     mac/Plugins/Hosted/WebKitPluginAgentReply.defs
144     mac/Plugins/Hosted/WebKitPluginClient.defs
145     mac/Plugins/Hosted/WebKitPluginHost.defs
146     mac/Plugins/Hosted/WebKitPluginHostTypes.defs
147     mac/Plugins/Hosted/WebTextInputWindowController.m
148
149     mac/Storage/WebDatabaseManager.mm
150     mac/Storage/WebDatabaseManagerClient.mm
151     mac/Storage/WebDatabaseQuotaManager.mm
152     mac/Storage/WebStorageManager.mm
153     mac/Storage/WebStorageTrackerClient.mm
154
155     mac/WebCoreSupport/CorrectionPanel.mm
156     mac/WebCoreSupport/PopupMenuMac.mm
157     mac/WebCoreSupport/SearchPopupMenuMac.mm
158     mac/WebCoreSupport/WebAlternativeTextClient.mm
159     mac/WebCoreSupport/WebApplicationCache.mm
160     mac/WebCoreSupport/WebApplicationCacheQuotaManager.mm
161     mac/WebCoreSupport/WebChromeClient.mm
162     mac/WebCoreSupport/WebContextMenuClient.mm
163     mac/WebCoreSupport/WebDeviceOrientationClient.mm
164     mac/WebCoreSupport/WebDragClient.mm
165     mac/WebCoreSupport/WebEditorClient.mm
166     mac/WebCoreSupport/WebFrameLoaderClient.mm
167     mac/WebCoreSupport/WebFrameNetworkingContext.mm
168     mac/WebCoreSupport/WebGeolocationClient.mm
169     mac/WebCoreSupport/WebIconDatabaseClient.mm
170     mac/WebCoreSupport/WebInspectorClient.mm
171     mac/WebCoreSupport/WebJavaScriptTextInputPanel.m
172     mac/WebCoreSupport/WebKeyGenerator.mm
173     mac/WebCoreSupport/WebKitFullScreenListener.mm
174     mac/WebCoreSupport/WebNotificationClient.mm
175     mac/WebCoreSupport/WebOpenPanelResultListener.mm
176     mac/WebCoreSupport/WebPlatformStrategies.mm
177     mac/WebCoreSupport/WebProgressTrackerClient.mm
178     mac/WebCoreSupport/WebSecurityOrigin.mm
179     mac/WebCoreSupport/WebSystemInterface.mm
180     mac/WebCoreSupport/WebUserMediaClient.mm
181     mac/WebCoreSupport/WebVisitedLinkStore.mm
182
183     mac/WebInspector/WebInspector.mm
184     mac/WebInspector/WebInspectorFrontend.mm
185     mac/WebInspector/WebNodeHighlight.mm
186     mac/WebInspector/WebNodeHighlightView.mm
187     mac/WebInspector/WebNodeHighlighter.mm
188
189     mac/WebView/WebArchive.mm
190     mac/WebView/WebClipView.mm
191     mac/WebView/WebDashboardRegion.mm
192     mac/WebView/WebDataSource.mm
193     mac/WebView/WebDelegateImplementationCaching.mm
194     mac/WebView/WebDeviceOrientation.mm
195     mac/WebView/WebDeviceOrientationProviderMock.mm
196     mac/WebView/WebDocumentLoaderMac.mm
197     mac/WebView/WebDynamicScrollBarsView.mm
198     mac/WebView/WebFormDelegate.m
199     mac/WebView/WebFrame.mm
200     mac/WebView/WebFrameView.mm
201     mac/WebView/WebFullScreenController.mm
202     mac/WebView/WebGeolocationPosition.mm
203     mac/WebView/WebHTMLRepresentation.mm
204     mac/WebView/WebHTMLView.mm
205     mac/WebView/WebImmediateActionController.mm
206     mac/WebView/WebIndicateLayer.mm
207     mac/WebView/WebJSPDFDoc.mm
208     mac/WebView/WebNavigationData.mm
209     mac/WebView/WebNotification.mm
210     mac/WebView/WebPDFDocumentExtras.mm
211     mac/WebView/WebPDFRepresentation.mm
212     mac/WebView/WebPDFView.mm
213     mac/WebView/WebPolicyDelegate.mm
214     mac/WebView/WebPreferences.mm
215     mac/WebView/WebResource.mm
216     mac/WebView/WebScriptDebugDelegate.mm
217     mac/WebView/WebScriptDebugger.mm
218     mac/WebView/WebScriptWorld.mm
219     mac/WebView/WebTextCompletionController.mm
220     mac/WebView/WebTextIterator.mm
221     mac/WebView/WebView.mm
222     mac/WebView/WebViewData.mm
223 )
224
225 set(WebKit_LIBRARY_TYPE SHARED)
226
227 set(WebKitLegacy_FORWARDING_HEADERS_DIRECTORIES
228     mac/DOM
229     mac/DefaultDelegates
230     mac/History
231     mac/Misc
232     mac/Panels
233     mac/Plugins
234     mac/WebCoreSupport
235     mac/WebInspector
236     mac/WebView
237 )
238
239 set(WebKitLegacy_FORWARDING_HEADERS_FILES
240     mac/DOM/WebDOMOperations.h
241
242     mac/History/WebHistory.h
243     mac/History/WebHistoryItem.h
244
245     mac/Misc/WebNSURLExtras.h
246
247     mac/Panels/WebPanelAuthenticationHandler.h
248
249     mac/Plugins/WebBasePluginPackage.h
250
251     mac/WebCoreSupport/WebKeyGenerator.h
252
253     mac/WebInspector/WebInspector.h
254
255     mac/WebView/WebFrame.h
256     mac/WebView/WebView.h
257
258     ${DERIVED_SOURCES_WEBCORE_DIR}/DOMRange.h
259
260     ${WEBCORE_DIR}/bindings/objc/DOMCore.h
261     ${WEBCORE_DIR}/bindings/objc/DOMExtensions.h
262
263     ${WEBCORE_DIR}/plugins/npfunctions.h
264 )
265
266 add_definitions("-include WebKitPrefix.h")
267
268 set(C99_FILES
269     ${WEBKIT_DIR}/mac/Carbon/CarbonUtils.m
270     ${WEBKIT_DIR}/mac/Carbon/CarbonWindowContentView.m
271     ${WEBKIT_DIR}/mac/Carbon/CarbonWindowFrame.m
272     ${WEBKIT_DIR}/mac/Carbon/HIViewAdapter.m
273
274     mac/DefaultDelegates/WebDefaultEditingDelegate.m
275     mac/DefaultDelegates/WebDefaultPolicyDelegate.m
276     mac/DefaultDelegates/WebDefaultUIDelegate.m
277
278     mac/Misc/OldWebAssertions.c
279
280     mac/Misc/WebKitErrors.m
281     mac/Misc/WebKitLogging.m
282     mac/Misc/WebKitStatistics.m
283     mac/Misc/WebKitSystemBits.m
284     mac/Misc/WebKitVersionChecks.m
285     mac/Misc/WebNSArrayExtras.m
286     mac/Misc/WebNSControlExtras.m
287     mac/Misc/WebNSDataExtras.m
288     mac/Misc/WebNSDictionaryExtras.m
289     mac/Misc/WebNSEventExtras.m
290     mac/Misc/WebNSImageExtras.m
291     mac/Misc/WebNSPrintOperationExtras.m
292     mac/Misc/WebNSURLRequestExtras.m
293     mac/Misc/WebNSViewExtras.m
294     mac/Misc/WebNSWindowExtras.m
295
296     mac/Panels/WebAuthenticationPanel.m
297     mac/Panels/WebPanelAuthenticationHandler.m
298
299     mac/Plugins/WebPluginRequest.m
300     mac/Plugins/WebPluginsPrivate.m
301
302     mac/Plugins/Hosted/WebTextInputWindowController.m
303
304     mac/WebCoreSupport/WebJavaScriptTextInputPanel.m
305
306     mac/WebView/WebFormDelegate.m
307 )
308
309 foreach (_file ${WebKit_SOURCES})
310     list(FIND C99_FILES ${_file} _c99_index)
311     if (${_c99_index} EQUAL -1)
312         set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-ObjC++ -std=c++11")
313     else ()
314         set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS -std=c99)
315     endif ()
316 endforeach ()
317
318 file(COPY
319     mac/Plugins/Hosted/WebKitPluginAgent.defs
320     mac/Plugins/Hosted/WebKitPluginAgentReply.defs
321     mac/Plugins/Hosted/WebKitPluginClient.defs
322     mac/Plugins/Hosted/WebKitPluginHost.defs
323     mac/Plugins/Hosted/WebKitPluginHostTypes.defs
324     mac/Plugins/Hosted/WebKitPluginHostTypes.h
325 DESTINATION ${DERIVED_SOURCES_WEBKITLEGACY_DIR})
326
327 add_custom_command(
328     OUTPUT
329         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentReplyServer.c
330         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentReplyUser.c
331         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentServer.c
332         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentUser.c
333         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginHostServer.c
334         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginHostUser.c
335     MAIN_DEPENDENCY mac/Plugins/Hosted/WebKitPluginAgent.defs
336     WORKING_DIRECTORY ${DERIVED_SOURCES_WEBKITLEGACY_DIR}
337     COMMAND mig -I.. WebKitPluginAgent.defs WebKitPluginAgentReply.defs WebKitPluginHost.defs
338     VERBATIM)
339 add_custom_command(
340     OUTPUT
341         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginClientServer.c
342         ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginClientUser.c
343     MAIN_DEPENDENCY mac/Plugins/Hosted/WebKitPluginAgent.defs
344     WORKING_DIRECTORY ${DERIVED_SOURCES_WEBKITLEGACY_DIR}
345     COMMAND mig -I.. -sheader WebKitPluginClientServer.h WebKitPluginClient.defs
346     VERBATIM)
347 list(APPEND WebKit_SOURCES
348     ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginAgentUser.c
349     ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginClientServer.c
350     ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/WebKitPluginHostUser.c
351 )
352
353 WEBKIT_CREATE_FORWARDING_HEADERS(WebKitLegacy DIRECTORIES ${WebKitLegacy_FORWARDING_HEADERS_DIRECTORIES} FILES ${WebKitLegacy_FORWARDING_HEADERS_FILES})
354 WEBKIT_CREATE_FORWARDING_HEADERS(WebKit DIRECTORIES ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy)
355
356 # FIXME: Forwarding headers should be copies of actual headers.
357 file(GLOB ObjCHeaders ${WEBCORE_DIR}/bindings/objc/*.h)
358 foreach (_file ${ObjCHeaders})
359     get_filename_component(_name ${_file} NAME)
360     if (NOT EXISTS ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy/${_name})
361         file(WRITE ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy/${_name} "#import <WebCore/${_name}>")
362     endif ()
363 endforeach ()
364 file(GLOB ObjCHeaders ${WEBCORE_DIR}/plugins/*.h)
365 foreach (_file ${ObjCHeaders})
366     get_filename_component(_name ${_file} NAME)
367     if (NOT EXISTS ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy/${_name})
368         file(WRITE ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy/${_name} "#import <WebCore/${_name}>")
369     endif ()
370 endforeach ()
371
372 set(WebKit_OUTPUT_NAME WebKitLegacy)
373
374 set(WebKitLegacy_WebCore_FORWARDING_HEADERS
375     DOMElement.h
376     DOMHTMLFormElement.h
377     DOMHTMLInputElement.h
378     DOMWheelEvent.h
379 )
380
381 # FIXME: These shouldn't be necessary, but it doesn't compile without them.
382 foreach (_file ${WebKitLegacy_WebCore_FORWARDING_HEADERS})
383     if (NOT EXISTS ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/${_file})
384         file(WRITE ${DERIVED_SOURCES_WEBKITLEGACY_DIR}/${_file} "#import <WebCore/${_file}>")
385     endif ()
386 endforeach ()