[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformWPE.cmake
1 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI")
2
3 add_custom_target(TestWebKitAPI-forwarding-headers
4     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${FORWARDING_HEADERS_DIR} --platform wpe --platform soup
5     DEPENDS webkitwpe-forwarding-headers
6 )
7
8 list(APPEND TestWebKit_DEPENDENCIES TestWebKitAPI-forwarding-headers)
9
10 include_directories(SYSTEM
11     ${CAIRO_INCLUDE_DIRS}
12     ${GLIB_INCLUDE_DIRS}
13     ${GSTREAMER_INCLUDE_DIRS}
14     ${GSTREAMER_AUDIO_INCLUDE_DIRS}
15     ${LIBSOUP_INCLUDE_DIRS}
16     ${WPE_INCLUDE_DIRS}
17     ${WPEBACKEND_FDO_INCLUDE_DIRS}
18 )
19
20 set(test_main_SOURCES generic/main.cpp)
21
22 # TestWTF
23 list(APPEND TestWTF_SOURCES
24     ${test_main_SOURCES}
25
26     Tests/WTF/glib/GUniquePtr.cpp
27     Tests/WTF/glib/WorkQueueGLib.cpp
28
29     glib/UtilitiesGLib.cpp
30 )
31
32 list(APPEND TestWTF_SYSTEM_INCLUDE_DIRECTORIES
33     ${GLIB_INCLUDE_DIRS}
34 )
35
36 # TestWebCore
37 list(APPEND TestWebCore_SOURCES
38     ${test_main_SOURCES}
39
40     Tests/WebCore/gstreamer/GStreamerTest.cpp
41     Tests/WebCore/gstreamer/GstMappedBuffer.cpp
42
43     glib/UtilitiesGLib.cpp
44 )
45
46 list(APPEND TestWebCore_SYSTEM_INCLUDE_DIRECTORIES
47     ${GLIB_INCLUDE_DIRS}
48 )
49
50 # TestWebKit
51 list(APPEND TestWebKit_SOURCES
52     ${test_main_SOURCES}
53
54     ${TOOLS_DIR}/wpe/backends/ViewBackend.cpp
55     ${TOOLS_DIR}/wpe/backends/HeadlessViewBackend.cpp
56
57     glib/UtilitiesGLib.cpp
58
59     wpe/PlatformUtilitiesWPE.cpp
60     wpe/PlatformWebViewWPE.cpp
61 )
62
63 list(APPEND TestWebKit_PRIVATE_INCLUDE_DIRECTORIES
64     ${CMAKE_SOURCE_DIR}/Source
65     ${FORWARDING_HEADERS_DIR}
66     ${WPEBACKEND_FDO_INCLUDE_DIRS}
67     ${TOOLS_DIR}/wpe/backends
68 )
69
70 list(APPEND TestWebKit_SYSTEM_INCLUDE_DIRECTORIES
71     ${GLIB_INCLUDE_DIRS}
72 )
73
74 list(APPEND TestWebKit_LIBRARIES
75     ${WPEBACKEND_FDO_LIBRARIES}
76     WPEToolingBackends
77 )
78
79 # TestWebKitAPIBase
80 target_include_directories(TestWebKitAPIBase PRIVATE
81     ${CMAKE_SOURCE_DIR}/Source
82     ${FORWARDING_HEADERS_DIR}
83 )
84
85 # TestWebKitAPIInjectedBundle
86 target_sources(TestWebKitAPIInjectedBundle PRIVATE
87     glib/UtilitiesGLib.cpp
88
89     wpe/InjectedBundleControllerWPE.cpp
90     wpe/PlatformUtilitiesWPE.cpp
91 )
92 target_include_directories(TestWebKitAPIInjectedBundle PRIVATE
93     ${CMAKE_SOURCE_DIR}/Source
94     ${FORWARDING_HEADERS_DIR}
95 )
96
97 # TestJSC
98 set(TestJSC_SOURCES
99     Tests/JavaScriptCore/glib/TestJSC.cpp
100 )
101
102 set(TestJSC_PRIVATE_INCLUDE_DIRECTORIES
103     ${CMAKE_BINARY_DIR}
104     ${TESTWEBKITAPI_DIR}
105     ${THIRDPARTY_DIR}/gtest/include
106     ${WTF_FRAMEWORK_HEADERS_DIR}
107     ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
108     ${FORWARDING_HEADERS_DIR}
109     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
110     ${FORWARDING_HEADERS_DIR}/JavaScriptCore/glib
111     ${DERIVED_SOURCES_JAVASCRIPCOREWPE_DIR}
112 )
113
114 set(TestJSC_LIBRARIES
115     ${GLIB_LIBRARIES}
116     ${GLIB_GMODULE_LIBRARIES}
117     JavaScriptCore
118 )
119
120 set(TestJSC_DEPENDENCIES
121     JavaScriptCorePrivateFrameworkHeaders
122 )
123
124 set(TestJSC_DEFINITIONS
125     WEBKIT_SRC_DIR="${CMAKE_SOURCE_DIR}"
126 )
127
128 WEBKIT_EXECUTABLE_DECLARE(TestJSC)
129 WEBKIT_TEST(TestJSC)