[Win][CMake] Use add_custom_command to copy each forwarding header files
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformWin.cmake
1 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
2 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}")
3 add_definitions(-DUSE_CONSOLE_ENTRY_POINT)
4
5 if (${WTF_PLATFORM_WIN_CAIRO})
6     add_definitions(-DWIN_CAIRO)
7 endif ()
8
9 set(test_main_SOURCES
10     ${TESTWEBKITAPI_DIR}/win/main.cpp
11 )
12
13 include_directories(
14     ${DERIVED_SOURCES_DIR}
15     ${FORWARDING_HEADERS_DIR}
16     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
17     ${TESTWEBKITAPI_DIR}/win
18     ${DERIVED_SOURCES_DIR}/WebKit/Interfaces
19 )
20
21 add_definitions(-DWEBCORE_EXPORT=)
22
23 set(test_webcore_LIBRARIES
24     Crypt32
25     D2d1
26     Dwrite
27     dxguid
28     Iphlpapi
29     Psapi
30     Shlwapi
31     Usp10
32     WebCore${DEBUG_SUFFIX}
33     WebCoreDerivedSources${DEBUG_SUFFIX}
34     WindowsCodecs
35     gtest
36 )
37
38 set(TestWebCoreLib_SOURCES
39     ${test_main_SOURCES}
40     win/TestWebCoreStubs.cpp
41     ${TESTWEBKITAPI_DIR}/TestsController.cpp
42     ${TESTWEBKITAPI_DIR}/Tests/WebCore/AffineTransform.cpp
43     ${TESTWEBKITAPI_DIR}/Tests/WebCore/CalculationValue.cpp
44     ${TESTWEBKITAPI_DIR}/Tests/WebCore/ComplexTextController.cpp
45     ${TESTWEBKITAPI_DIR}/Tests/WebCore/CSSParser.cpp
46     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatRect.cpp
47     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatPoint.cpp
48     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatSize.cpp
49     ${TESTWEBKITAPI_DIR}/Tests/WebCore/GridPosition.cpp
50     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
51     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntRect.cpp
52     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntPoint.cpp
53     ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntSize.cpp
54     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
55     ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp
56     ${TESTWEBKITAPI_DIR}/Tests/WebCore/ParsedContentRange.cpp
57     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SecurityOrigin.cpp
58     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
59     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
60     ${TESTWEBKITAPI_DIR}/Tests/WebCore/TimeRanges.cpp
61     ${TESTWEBKITAPI_DIR}/Tests/WebCore/TransformationMatrix.cpp
62     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
63     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URLParser.cpp
64     ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/DIBPixelData.cpp
65     ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/LinkedFonts.cpp
66 )
67
68 if (${WTF_PLATFORM_WIN_CAIRO})
69     list(APPEND test_webcore_LIBRARIES
70         ${CAIRO_LIBRARIES}
71         ${OPENSSL_LIBRARIES}
72         libANGLE
73         mfuuid
74         strmiids
75         vcruntime
76     )
77     list(APPEND TestWebCoreLib_SOURCES
78         ${TESTWEBKITAPI_DIR}/Tests/WebCore/win/BitmapImage.cpp
79     )
80 else ()
81     list(APPEND test_webcore_LIBRARIES
82         ASL${DEBUG_SUFFIX}
83         CFNetwork${DEBUG_SUFFIX}
84         CoreGraphics${DEBUG_SUFFIX}
85         CoreText${DEBUG_SUFFIX}
86         QuartzCore${DEBUG_SUFFIX}
87         WebKitSystemInterface${DEBUG_SUFFIX}
88         WebKitQuartzCoreAdditions${DEBUG_SUFFIX}
89         libdispatch${DEBUG_SUFFIX}
90         libexslt${DEBUG_SUFFIX}
91         libicuin${DEBUG_SUFFIX}
92         libicuuc${DEBUG_SUFFIX}
93     )
94 endif ()
95
96 if (USE_CF)
97     list(APPEND test_webcore_LIBRARIES
98         ${COREFOUNDATION_LIBRARY}
99     )
100 endif ()
101
102 add_library(TestWTFLib SHARED
103     ${test_main_SOURCES}
104     ${TestWTF_SOURCES}
105 )
106 set_target_properties(TestWTFLib PROPERTIES OUTPUT_NAME "TestWTFLib")
107 target_link_libraries(TestWTFLib ${test_wtf_LIBRARIES})
108 add_dependencies(TestWTFLib WebCoreForwardingHeaders)
109
110 set(test_wtf_LIBRARIES
111     shlwapi
112 )
113 set(TestWTF_SOURCES
114 )
115
116 add_library(TestWebCoreLib SHARED
117     ${TestWebCoreLib_SOURCES}
118 )
119
120 target_link_libraries(TestWebCoreLib ${test_webcore_LIBRARIES})
121 set_target_properties(TestWebCoreLib PROPERTIES OUTPUT_NAME "TestWebCoreLib")
122
123 add_executable(TestWebCore
124     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
125 )
126 target_link_libraries(TestWebCore shlwapi)
127
128
129 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebCore)
130 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
131
132 if (${WTF_PLATFORM_WIN_CAIRO})
133     include_directories(
134         ${CAIRO_INCLUDE_DIRS}
135     )
136 endif ()
137
138 set(test_webkitlegacy_LIBRARIES
139     WebCoreTestSupport
140     WebKitLegacy${DEBUG_SUFFIX}
141     gtest
142 )
143 add_library(TestWebKitLegacyLib SHARED
144     ${test_main_SOURCES}
145     ${TESTWEBKITAPI_DIR}/TestsController.cpp
146     ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/ScaleWebView.cpp
147     ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/win/WebViewDestruction.cpp
148     ${TESTWEBKITAPI_DIR}/win/HostWindow.cpp
149 )
150
151 target_link_libraries(TestWebKitLegacyLib ${test_webkitlegacy_LIBRARIES})
152
153 add_executable(TestWebKitLegacy
154     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
155 )
156 target_link_libraries(TestWebKitLegacy shlwapi)
157
158 add_test(TestWebKitLegacy ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitLegacy)
159 set_tests_properties(TestWebKitLegacy PROPERTIES TIMEOUT 60)
160
161 set(test_main_SOURCES
162     ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
163 )
164
165 add_dependencies(TestWebCore TestWebCoreLib)
166 add_dependencies(TestWebKitLegacy TestWebKitLegacyLib)