[CMAKE] Supply feature defines to CodeGeneratorTestRunner.
[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
4 FILE(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/InjectedBundle)
5
6 SET(WebKitTestRunner_SOURCES
7     ${WEBKIT_TESTRUNNER_DIR}/CyclicRedundancyCheck.cpp
8     ${WEBKIT_TESTRUNNER_DIR}/PixelDumpSupport.cpp
9     ${WEBKIT_TESTRUNNER_DIR}/TestController.cpp
10     ${WEBKIT_TESTRUNNER_DIR}/TestInvocation.cpp
11     ${WEBKIT_TESTRUNNER_DIR}/WebNotificationProvider.cpp
12 )
13
14 SET(WebKitTestRunner_LIBRARIES
15     ${JavaScriptCore_LIBRARY_NAME}
16     ${WebCore_LIBRARY_NAME}
17     ${WebCoreTestSupport_LIBRARY_NAME}
18     ${WebKit2_LIBRARY_NAME}
19 )
20
21 SET(WebKitTestRunner_INCLUDE_DIRECTORIES
22     ${WEBKIT_TESTRUNNER_DIR}
23     ${WEBKIT_TESTRUNNER_DIR}/InjectedBundle
24     ${WEBKIT_TESTRUNNER_DIR}/InjectedBundle/Bindings
25     ${JAVASCRIPTCORE_DIR}
26     ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
27     ${WEBCORE_DIR}/editing
28     ${WEBCORE_DIR}/platform
29     ${WEBCORE_DIR}/platform/graphics
30     ${WEBCORE_DIR}/platform/graphics/harfbuzz
31     ${WEBCORE_DIR}/platform/graphics/harfbuzz/ng
32     ${WEBCORE_DIR}/platform/network
33     ${WEBCORE_DIR}/platform/text
34     ${WEBCORE_DIR}/testing/js
35     ${WEBKIT2_DIR}/Shared
36     ${WEBKIT2_DIR}/Shared/API/c
37     ${WEBKIT2_DIR}/UIProcess
38     ${WEBKIT2_DIR}/UIProcess/API/C/efl
39     ${WEBKIT2_DIR}/UIProcess/API/C/soup
40     ${WTF_DIR}
41     ${DERIVED_SOURCES_WEBCORE_DIR}/include
42     ${DERIVED_SOURCES_WEBKIT2_DIR}/include
43     ${DERIVED_SOURCES_DIR}/InjectedBundle
44     ${CMAKE_BINARY_DIR}
45     ${CMAKE_SOURCE_DIR}/Source
46     ${LIBSOUP_INCLUDE_DIRS}
47 )
48
49 SET(WebKitTestRunnerInjectedBundle_SOURCES
50     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/AccessibilityController.cpp
51     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/AccessibilityTextMarker.cpp
52     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/AccessibilityTextMarkerRange.cpp
53     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/AccessibilityUIElement.cpp
54     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/EventSendingController.cpp
55     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/GCController.cpp
56     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundle.cpp
57     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundleMain.cpp
58     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundlePage.cpp
59     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TestRunner.cpp
60     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TextInputController.cpp
61
62     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/JSWrapper.cpp
63 )
64
65 FILE(GLOB WebKitTestRunnerInjectedBundle_IDL_FILES "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/*.idl")
66
67 GENERATE_BINDINGS(WebKitTestRunnerInjectedBundle_SOURCES
68     "${WebKitTestRunnerInjectedBundle_IDL_FILES}"
69     "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings"
70     "--include=${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings"
71     "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}"
72     ${DERIVED_SOURCES_DIR}/InjectedBundle JS TestRunner
73     )
74
75 INCLUDE_IF_EXISTS(${WEBKIT_TESTRUNNER_DIR}/Platform${PORT}.cmake)
76
77 INCLUDE_DIRECTORIES(${WebKitTestRunner_INCLUDE_DIRECTORIES})
78
79 ADD_LIBRARY(TestRunnerInjectedBundle SHARED ${WebKitTestRunnerInjectedBundle_SOURCES})
80 TARGET_LINK_LIBRARIES(TestRunnerInjectedBundle ${WebKitTestRunner_LIBRARIES})
81
82 ADD_EXECUTABLE(WebKitTestRunner ${WebKitTestRunner_SOURCES})
83 TARGET_LINK_LIBRARIES(WebKitTestRunner ${WebKitTestRunner_LIBRARIES})
84
85 ADD_DEPENDENCIES(${WebKit2_LIBRARY_NAME} ${ForwardingHeadersForWebKitTestRunner_NAME})
86 ADD_DEPENDENCIES(${WebKit2_LIBRARY_NAME} ${ForwardingNetworkHeadersForWebKitTestRunner_NAME})