Compile WebKitTestRunner with CMake on Mac
[WebKit-https.git] / Tools / WebKitTestRunner / CMakeLists.txt
1 set(WEBKIT_TESTRUNNER_DIR "${TOOLS_DIR}/WebKitTestRunner")
2 set(WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR "${TOOLS_DIR}/WebKitTestRunner/InjectedBundle")
3 set(WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR "${TOOLS_DIR}/WebKitTestRunner/UIScriptContext")
4
5 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/InjectedBundle)
6 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/UIScriptContext)
7
8 set(WebKitTestRunner_SOURCES
9     ${WEBKIT_TESTRUNNER_DIR}/CyclicRedundancyCheck.cpp
10     ${WEBKIT_TESTRUNNER_DIR}/GeolocationProviderMock.cpp
11     ${WEBKIT_TESTRUNNER_DIR}/Options.cpp
12     ${WEBKIT_TESTRUNNER_DIR}/PixelDumpSupport.cpp
13     ${WEBKIT_TESTRUNNER_DIR}/TestController.cpp
14     ${WEBKIT_TESTRUNNER_DIR}/TestInvocation.cpp
15     ${WEBKIT_TESTRUNNER_DIR}/TestOptions.cpp
16     ${WEBKIT_TESTRUNNER_DIR}/WebNotificationProvider.cpp
17     ${WEBKIT_TESTRUNNER_DIR}/WorkQueueManager.cpp
18     ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/UIScriptContext.cpp
19     ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/UIScriptController.cpp
20
21     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/JSWrapper.cpp
22 )
23
24 set(WebKitTestRunner_LIBRARIES
25     JavaScriptCore
26     WebCoreTestSupport
27     WebKit2
28 )
29
30 set(WebKitTestRunner_INCLUDE_DIRECTORIES
31     ${WEBKIT_TESTRUNNER_DIR}
32     ${WEBKIT_TESTRUNNER_DIR}/InjectedBundle
33     ${WEBKIT_TESTRUNNER_DIR}/InjectedBundle/Bindings
34     ${WEBKIT_TESTRUNNER_DIR}/InjectedBundle/atk
35     ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}
36     ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/Bindings
37     ${JAVASCRIPTCORE_DIR}
38     ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
39     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
40     ${WEBCORE_DIR}/editing
41     ${WEBCORE_DIR}/platform
42     ${WEBCORE_DIR}/platform/graphics
43     ${WEBCORE_DIR}/platform/graphics/harfbuzz
44     ${WEBCORE_DIR}/platform/graphics/harfbuzz/ng
45     ${WEBCORE_DIR}/platform/network
46     ${WEBCORE_DIR}/platform/text
47     ${WEBCORE_DIR}/testing/js
48     ${WEBKIT2_DIR}/Platform/IPC
49     ${WEBKIT2_DIR}/Shared
50     ${WEBKIT2_DIR}/Shared/API/c
51     ${WEBKIT2_DIR}/Shared/Plugins
52     ${WEBKIT2_DIR}/UIProcess
53     ${WEBKIT2_DIR}/UIProcess/API/C/soup
54     ${WEBKIT2_DIR}/WebProcess/InjectedBundle
55     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c
56     ${WTF_DIR}
57     ${DERIVED_SOURCES_DIR}/InjectedBundle
58     ${DERIVED_SOURCES_DIR}/UIScriptContext
59     ${CMAKE_BINARY_DIR}
60     ${CMAKE_SOURCE_DIR}/Source
61 )
62
63 set(WebKitTestRunner_SYSTEM_INCLUDE_DIRECTORIES
64     ${LIBSOUP_INCLUDE_DIRS}
65     ${ICU_INCLUDE_DIRS}
66 )
67
68 set(WebKitTestRunnerInjectedBundle_SOURCES
69     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/AccessibilityController.cpp
70     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/AccessibilityTextMarker.cpp
71     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/AccessibilityTextMarkerRange.cpp
72     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/AccessibilityUIElement.cpp
73     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/EventSendingController.cpp
74     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/GCController.cpp
75     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundle.cpp
76     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundleMain.cpp
77     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundlePage.cpp
78     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TestRunner.cpp
79     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TextInputController.cpp
80
81     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/JSWrapper.cpp
82 )
83
84 set(WebKitTestRunnerInjectedBundle_IDL_FILES
85     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/AccessibilityController.idl"
86     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/AccessibilityTextMarker.idl"
87     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/AccessibilityTextMarkerRange.idl"
88     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/AccessibilityUIElement.idl"
89     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/EventSendingController.idl"
90     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/GCController.idl"
91     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/TestRunner.idl"
92     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/TextInputController.idl"
93 )
94
95 set(WebKitTestRunner_IDL_FILES
96     "${WEBKIT_TESTRUNNER_DIR}/UIScriptContext/Bindings/UIScriptController.idl"
97 )
98
99 GENERATE_BINDINGS(WebKitTestRunnerInjectedBundle_SOURCES
100     "${WebKitTestRunnerInjectedBundle_IDL_FILES}"
101     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings"
102     "--include=${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings"
103     "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}"
104     ${DERIVED_SOURCES_DIR}/InjectedBundle JS TestRunner cpp
105     ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt)
106
107 GENERATE_BINDINGS(WebKitTestRunner_SOURCES
108     "${WebKitTestRunner_IDL_FILES}"
109     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings"
110     "--include=${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings"
111     "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}"
112     ${DERIVED_SOURCES_DIR}/UIScriptContext JS TestRunner cpp
113     ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt)
114
115 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
116
117 include_directories(${WebKitTestRunner_INCLUDE_DIRECTORIES})
118 include_directories(SYSTEM ${WebKitTestRunner_SYSTEM_INCLUDE_DIRECTORIES})
119
120 add_library(TestRunnerInjectedBundle SHARED ${WebKitTestRunnerInjectedBundle_SOURCES})
121 target_link_libraries(TestRunnerInjectedBundle ${WebKitTestRunner_LIBRARIES})
122
123 add_executable(WebKitTestRunner ${WebKitTestRunner_SOURCES})
124 target_link_libraries(WebKitTestRunner ${WebKitTestRunner_LIBRARIES})
125
126 if (NOT APPLE)
127     add_dependencies(WebKit2 ${ForwardingHeadersForWebKitTestRunner_NAME})
128 endif ()