98e48e5fd0614d555fbe48feb725d757dc94bdcc
[WebKit-https.git] / Tools / DumpRenderTree / PlatformMac.cmake
1 find_library(QUARTZ_LIBRARY Quartz)
2 find_library(CARBON_LIBRARY Carbon)
3 find_library(CORESERVICES_LIBRARY CoreServices)
4 add_definitions(-iframework ${QUARTZ_LIBRARY}/Frameworks -iframework ${CORESERVICES_LIBRARY}/Frameworks)
5
6 if ("${CURRENT_OSX_VERSION}" MATCHES "10.9")
7 set(WEBKITSYSTEMINTERFACE_LIBRARY libWebKitSystemInterfaceMavericks.a)
8 elif ("${CURRENT_OSX_VERSION}" MATCHES "10.10")
9 set(WEBKITSYSTEMINTERFACE_LIBRARY libWebKitSystemInterfaceYosemite.a)
10 else ()
11 set(WEBKITSYSTEMINTERFACE_LIBRARY libWebKitSystemInterfaceElCapitan.a)
12 endif ()
13 link_directories(../../WebKitLibraries)
14
15 list(APPEND TestNetscapePlugIn_LIBRARIES
16     ${QUARTZ_LIBRARY}
17     WebKit2
18 )
19
20 list(APPEND DumpRenderTree_LIBRARIES
21     ${CARBON_LIBRARY}
22     ${QUARTZ_LIBRARY}
23     ${WEBKITSYSTEMINTERFACE_LIBRARY}
24     WebKit2
25 )
26
27 if ("${CURRENT_OSX_VERSION}" MATCHES "10.9")
28 set(WEBKITSYSTEMINTERFACE_LIBRARY libWebKitSystemInterfaceMavericks.a)
29 elif ("${CURRENT_OSX_VERSION}" MATCHES "10.10")
30 set(WEBKITSYSTEMINTERFACE_LIBRARY libWebKitSystemInterfaceYosemite.a)
31 else ()
32 set(WEBKITSYSTEMINTERFACE_LIBRARY libWebKitSystemInterfaceElCapitan.a)
33 endif ()
34 link_directories(../../WebKitLibraries)
35 include_directories(../../WebKitLibraries)
36
37 list(APPEND DumpRenderTree_INCLUDE_DIRECTORIES
38     cg
39     cf
40     mac
41     mac/InternalHeaders/WebKit
42     TestNetscapePlugIn
43     ${DERIVED_SOURCES_DIR}/ForwardingHeaders
44     ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebCore
45     ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKit
46     ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WebKitLegacy
47 )
48
49 # Common ${TestNetscapePlugIn_SOURCES} from CMakeLists.txt are C++ source files.
50 list(APPEND TestNetscapePlugIn_Cpp_SOURCES
51     ${TestNetscapePlugIn_SOURCES}
52 )
53
54 list(APPEND TestNetscapePlugIn_ObjCpp_SOURCES
55     TestNetscapePlugIn/PluginObjectMac.mm
56 )
57
58 set(TestNetscapePlugIn_SOURCES
59     ${TestNetscapePlugIn_Cpp_SOURCES}
60     ${TestNetscapePlugIn_ObjCpp_SOURCES}
61 )
62
63 # Common ${DumpRenderTree_SOURCES} from CMakeLists.txt are C++ source files.
64 list(APPEND DumpRenderTree_Cpp_SOURCES
65     ${DumpRenderTree_SOURCES}
66 )
67
68 list(APPEND DumpRenderTree_ObjC_SOURCES
69     DefaultPolicyDelegate.m
70     DumpRenderTreeFileDraggingSource.m
71
72     mac/AppleScriptController.m
73     mac/DumpRenderTreePasteboard.m
74     mac/NavigationController.m
75     mac/ObjCController.m
76     mac/ObjCPlugin.m
77     mac/ObjCPluginFunction.m
78     mac/TextInputControllerMac.m
79 )
80
81 list(APPEND DumpRenderTree_Cpp_SOURCES
82     cf/WebArchiveDumpSupport.cpp
83
84     cg/PixelDumpSupportCG.cpp
85 )
86
87 list(APPEND DumpRenderTree_ObjCpp_SOURCES
88     TestOptions.mm
89
90     mac/AccessibilityCommonMac.mm
91     mac/AccessibilityControllerMac.mm
92     mac/AccessibilityNotificationHandler.mm
93     mac/AccessibilityTextMarkerMac.mm
94     mac/AccessibilityUIElementMac.mm
95     mac/DumpRenderTree.mm
96     mac/DumpRenderTreeDraggingInfo.mm
97     mac/DumpRenderTreeMain.mm
98     mac/DumpRenderTreeWindow.mm
99     mac/EditingDelegate.mm
100     mac/EventSendingController.mm
101     mac/FrameLoadDelegate.mm
102     mac/GCControllerMac.mm
103     mac/HistoryDelegate.mm
104     mac/MockGeolocationProvider.mm
105     mac/MockWebNotificationProvider.mm
106     mac/PixelDumpSupportMac.mm
107     mac/PolicyDelegate.mm
108     mac/ResourceLoadDelegate.mm
109     mac/TestRunnerMac.mm
110     mac/UIDelegate.mm
111     mac/UIScriptControllerMac.mm
112     mac/WebArchiveDumpSupportMac.mm
113     mac/WorkQueueItemMac.mm
114 )
115
116 set(DumpRenderTree_SOURCES
117     ${DumpRenderTree_Cpp_SOURCES}
118     ${DumpRenderTree_ObjC_SOURCES}
119     ${DumpRenderTree_ObjCpp_SOURCES}
120 )
121
122 foreach (_file ${DumpRenderTree_ObjC_SOURCES})
123     set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-std=c99")
124 endforeach ()
125
126 foreach (_file ${DumpRenderTree_Cpp_SOURCES} ${TestNetscapePlugIn_Cpp_SOURCES})
127     set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-std=c++14")
128 endforeach ()
129
130 foreach (_file ${DumpRenderTree_ObjCpp_SOURCES} ${TestNetscapePlugIn_ObjCpp_SOURCES})
131     set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-ObjC++ -std=c++14")
132 endforeach ()
133
134 set(DumpRenderTree_RESOURCES
135     AHEM____.TTF
136     FontWithFeatures.otf
137     FontWithFeatures.ttf
138     WebKitWeightWatcher100.ttf
139     WebKitWeightWatcher200.ttf
140     WebKitWeightWatcher300.ttf
141     WebKitWeightWatcher400.ttf
142     WebKitWeightWatcher500.ttf
143     WebKitWeightWatcher600.ttf
144     WebKitWeightWatcher700.ttf
145     WebKitWeightWatcher800.ttf
146     WebKitWeightWatcher900.ttf
147 )
148
149 file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DumpRenderTree.resources)
150 foreach (_file ${DumpRenderTree_RESOURCES})
151     file(COPY ${TOOLS_DIR}/DumpRenderTree/fonts/${_file} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DumpRenderTree.resources)
152 endforeach ()