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