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