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