[EFL][GTK] Get CMake to find Freetype2 properly
[WebKit.git] / Source / WebKit / PlatformEfl.cmake
1 list(APPEND WebKit_INCLUDE_DIRECTORIES
2     "${WEBKIT_DIR}/efl/ewk"
3     "${WEBKIT_DIR}/efl/WebCoreSupport"
4     "${WEBCORE_DIR}/platform/efl"
5     "${WEBCORE_DIR}/platform/graphics/cairo"
6     "${WEBCORE_DIR}/platform/graphics/efl"
7     "${WEBCORE_DIR}/platform/graphics/freetype"
8     "${WEBCORE_DIR}/platform/graphics/opentype"
9     "${WEBCORE_DIR}/platform/mock"
10     "${WEBCORE_DIR}/platform/network/soup"
11     ${CAIRO_INCLUDE_DIRS}
12     ${ECORE_EVAS_INCLUDE_DIRS}
13     ${ECORE_INCLUDE_DIRS}
14     ${ECORE_INPUT_INCLUDE_DIRS}
15     ${ECORE_X_INCLUDE_DIRS}
16     ${EDJE_INCLUDE_DIRS}
17     ${EFREET_INCLUDE_DIRS}
18     ${EINA_INCLUDE_DIRS}
19     ${EO_INCLUDE_DIRS}
20     ${EVAS_INCLUDE_DIRS}
21     ${GLIB_INCLUDE_DIRS}
22     ${HARFBUZZ_INCLUDE_DIRS}
23     ${LIBSOUP_INCLUDE_DIRS}
24     ${LIBXML2_INCLUDE_DIR}
25     ${LIBXSLT_INCLUDE_DIR}
26     ${SQLITE_INCLUDE_DIR}
27 )
28
29 if (ENABLE_VIDEO)
30     list(APPEND WebKit_INCLUDE_DIRECTORIES
31         "${WEBCORE_DIR}/platform/graphics/gstreamer"
32         ${GSTREAMER_APP_INCLUDE_DIRS}
33         ${GSTREAMER_PBUTILS_INCLUDE_DIRS}
34         ${GSTREAMER_VIDEO_INCLUDE_DIRS}
35     )
36 endif ()
37
38 if (ENABLE_VIDEO_TRACK)
39     list(APPEND WebKit_INCLUDE_DIRECTORIES
40         "${WEBCORE_DIR}/html/track"
41     )
42 endif ()
43
44 if (ENABLE_NOTIFICATIONS)
45     list(APPEND WebKit_INCLUDE_DIRECTORIES
46         "${WEBCORE_DIR}/Modules/notifications"
47     )
48 endif ()
49
50 if (ENABLE_VIBRATION)
51     list(APPEND WebKit_INCLUDE_DIRECTORIES
52         "${WEBCORE_DIR}/Modules/vibration"
53     )
54 endif ()
55
56 if (ENABLE_BATTERY_STATUS)
57     list(APPEND WebKit_INCLUDE_DIRECTORIES
58         "${WEBCORE_DIR}/Modules/battery"
59     )
60 endif ()
61
62 if (ENABLE_NAVIGATOR_CONTENT_UTILS)
63     list(APPEND WebKit_INCLUDE_DIRECTORIES
64         "${WEBCORE_DIR}/Modules/navigatorcontentutils"
65     )
66 endif ()
67
68 if (WTF_USE_3D_GRAPHICS)
69     list(APPEND WebKit_INCLUDE_DIRECTORIES
70         "${WEBCORE_DIR}/platform/graphics/surfaces"
71         "${WEBCORE_DIR}/platform/graphics/texmap"
72         "${THIRDPARTY_DIR}/ANGLE/include/KHR"
73         "${THIRDPARTY_DIR}/ANGLE/include/GLSLANG"
74     )
75 endif ()
76
77 if (ENABLE_GEOLOCATION)
78     list(APPEND WebKit_INCLUDE_DIRECTORIES
79         "${WEBCORE_DIR}/Modules/geolocation"
80     )
81 endif ()
82
83 if (ENABLE_ACCESSIBILITY)
84     list(APPEND WebKit_INCLUDE_DIRECTORIES
85         "${WEBCORE_DIR}/accessibility"
86         "${WEBCORE_DIR}/accessibility/atk"
87         ${ATK_INCLUDE_DIRS}
88     )
89     list(APPEND WebKit_LIBRARIES
90         ${ATK_LIBRARIES}
91     )
92 endif ()
93
94 list(APPEND WebKit_SOURCES
95     efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp
96     efl/WebCoreSupport/BatteryClientEfl.cpp
97     efl/WebCoreSupport/ChromeClientEfl.cpp
98     efl/WebCoreSupport/ColorChooserEfl.cpp
99     efl/WebCoreSupport/ContextMenuClientEfl.cpp
100     efl/WebCoreSupport/DeviceMotionClientEfl.cpp
101     efl/WebCoreSupport/DeviceOrientationClientEfl.cpp
102     efl/WebCoreSupport/DragClientEfl.cpp
103     efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
104     efl/WebCoreSupport/EditorClientEfl.cpp
105     efl/WebCoreSupport/FrameLoaderClientEfl.cpp
106     efl/WebCoreSupport/FrameNetworkingContextEfl.cpp
107     efl/WebCoreSupport/IconDatabaseClientEfl.cpp
108     efl/WebCoreSupport/InspectorClientEfl.cpp
109     efl/WebCoreSupport/NavigatorContentUtilsClientEfl.cpp
110     efl/WebCoreSupport/NetworkInfoClientEfl.cpp
111     efl/WebCoreSupport/NotificationPresenterClientEfl.cpp
112     efl/WebCoreSupport/PlatformStrategiesEfl.cpp
113     efl/WebCoreSupport/ProgressTrackerClientEfl.cpp
114     efl/WebCoreSupport/PopupMenuEfl.cpp
115     efl/WebCoreSupport/SearchPopupMenuEfl.cpp
116     efl/WebCoreSupport/StorageTrackerClientEfl.cpp
117     efl/WebCoreSupport/VibrationClientEfl.cpp
118
119     efl/ewk/ewk_auth.cpp
120     efl/ewk/ewk_auth_soup.cpp
121     efl/ewk/ewk_contextmenu.cpp
122     efl/ewk/ewk_cookies.cpp
123     efl/ewk/ewk_custom_handler.cpp
124     efl/ewk/ewk_file_chooser.cpp
125     efl/ewk/ewk_frame.cpp
126     efl/ewk/ewk_history.cpp
127     efl/ewk/ewk_js.cpp
128     efl/ewk/ewk_main.cpp
129     efl/ewk/ewk_network.cpp
130     efl/ewk/ewk_paint_context.cpp
131     efl/ewk/ewk_security_origin.cpp
132     efl/ewk/ewk_security_policy.cpp
133     efl/ewk/ewk_settings.cpp
134     efl/ewk/ewk_touch_event.cpp
135     efl/ewk/ewk_view.cpp
136     efl/ewk/ewk_web_database.cpp
137     efl/ewk/ewk_window_features.cpp
138 )
139
140 list(APPEND WebKit_LIBRARIES
141     ${CAIRO_LIBRARIES}
142     ${CMAKE_DL_LIBS}
143     ${ECORE_EVAS_LIBRARIES}
144     ${ECORE_INPUT_LIBRARIES}
145     ${ECORE_LIBRARIES}
146     ${EDJE_LIBRARIES}
147     ${EFREET_LIBRARIES}
148     ${EINA_LIBRARIES}
149     ${EO_LIBRARIES}
150     ${EVAS_LIBRARIES}
151     ${FONTCONFIG_LIBRARIES}
152     ${FREETYPE2_LIBRARIES}
153     ${GLIB_GOBJECT_LIBRARIES}
154     ${GLIB_LIBRARIES}
155     ${HARFBUZZ_LIBRARIES}
156     ${JPEG_LIBRARIES}
157     ${LIBSOUP_LIBRARIES}
158     ${LIBXML2_LIBRARIES}
159     ${PNG_LIBRARIES}
160     ${SQLITE_LIBRARIES}
161 )
162
163 if (ENABLE_ECORE_X)
164     list(APPEND WebKit_LIBRARIES
165         ${ECORE_X_LIBRARIES}
166     )
167 endif ()
168
169 if (SHARED_CORE)
170     set(LIBS_PRIVATE "-l${WTF_OUTPUT_NAME} -l${JavaScriptCore_OUTPUT_NAME} -l${WebCore_OUTPUT_NAME}")
171 else ()
172     set(LIBS_PRIVATE "")
173 endif ()
174
175 configure_file(efl/ewebkit.pc.in ${CMAKE_BINARY_DIR}/WebKit/efl/ewebkit.pc @ONLY)
176 configure_file(efl/EWebKitConfig.cmake.in ${CMAKE_BINARY_DIR}/WebKit/efl/EWebKitConfig.cmake @ONLY)
177 configure_file(efl/EWebKitConfigVersion.cmake.in ${CMAKE_BINARY_DIR}/WebKit/efl/EWebKitConfigVersion.cmake @ONLY)
178 install(FILES ${CMAKE_BINARY_DIR}/WebKit/efl/ewebkit.pc DESTINATION lib/pkgconfig)
179 install(FILES
180         ${CMAKE_BINARY_DIR}/WebKit/efl/EWebKitConfig.cmake
181         ${CMAKE_BINARY_DIR}/WebKit/efl/EWebKitConfigVersion.cmake
182         DESTINATION lib/cmake/EWebKit)
183
184 unset(LIBS_PRIVATE)
185
186 set(EWebKit_HEADERS
187     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/EWebKit.h
188     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_auth.h
189     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_contextmenu.h
190     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_cookies.h
191     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_file_chooser.h
192     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_frame.h
193     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_history.h
194     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_js.h
195     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_main.h
196     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_network.h
197     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_security_origin.h
198     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_security_policy.h
199     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_settings.h
200     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_view.h
201     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_web_database.h
202     ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_window_features.h
203 )
204
205 install(FILES ${EWebKit_HEADERS}
206         DESTINATION include/${WebKit_OUTPUT_NAME}-${PROJECT_VERSION_MAJOR})
207
208 include_directories(${THIRDPARTY_DIR}/gtest/include)
209
210 set(EWKUnitTests_LIBRARIES
211     ${ECORE_EVAS_LIBRARIES}
212     ${ECORE_LIBRARIES}
213     ${EDJE_LIBRARIES}
214     ${EVAS_LIBRARIES}
215     JavaScriptCore
216     WTF
217     WebCore
218     WebKit
219     gtest
220 )
221
222 set(EWKUnitTests_INCLUDE_DIRECTORIES
223     "${CMAKE_SOURCE_DIR}/Source"
224     "${WEBKIT_DIR}/efl/ewk"
225     "${JAVASCRIPTCORE_DIR}"
226     "${WTF_DIR}"
227     "${WTF_DIR}/wtf"
228     ${ECORE_INCLUDE_DIRS}
229     ${ECORE_EVAS_INCLUDE_DIRS}
230     ${EVAS_INCLUDE_DIRS}
231     ${EDJE_INCLUDE_DIRS}
232 )
233
234 list(APPEND EWKUnitTests_INCLUDE_DIRECTORIES "${WTF_DIR}/wtf/gobject")
235 list(APPEND EWKUnitTests_LIBRARIES
236     ${GLIB_GTHREAD_LIBRARIES}
237     ${GLIB_LIBRARIES}
238 )
239
240 set(DEFAULT_TEST_PAGE_DIR ${CMAKE_SOURCE_DIR}/Source/WebKit/efl/tests/resources)
241
242 add_definitions(-DDEFAULT_TEST_PAGE_DIR=\"${DEFAULT_TEST_PAGE_DIR}\"
243     -DDEFAULT_THEME_PATH=\"${THEME_BINARY_DIR}\"
244     -DGTEST_LINKED_AS_SHARED_LIBRARY=1
245 )
246
247 add_library(ewkTestUtils
248     ${WEBKIT_DIR}/efl/tests/UnitTestUtils/EWKTestBase.cpp
249     ${WEBKIT_DIR}/efl/tests/UnitTestUtils/EWKTestEnvironment.cpp
250     ${WEBKIT_DIR}/efl/tests/UnitTestUtils/EWKTestView.cpp
251 )
252 target_link_libraries(ewkTestUtils ${EWKUnitTests_LIBRARIES})
253
254 set(WEBKIT_EFL_TEST_DIR "${WEBKIT_DIR}/efl/tests/")
255 set(WEBKIT_EFL_TEST_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI/EWebKit)
256
257 set(EWKUnitTests_BINARIES
258     test_ewk_contextmenu
259     test_ewk_frame
260     test_ewk_setting
261     test_ewk_view
262 )
263
264 if (ENABLE_API_TESTS)
265     foreach (testName ${EWKUnitTests_BINARIES})
266         add_executable(${testName} ${WEBKIT_EFL_TEST_DIR}/${testName}.cpp ${WEBKIT_EFL_TEST_DIR}/test_runner.cpp)
267         add_test(${testName} ${WEBKIT_EFL_TEST_RUNTIME_OUTPUT_DIRECTORY}/${testName})
268         set_tests_properties(${testName} PROPERTIES TIMEOUT 60)
269         set_target_properties(${testName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${WEBKIT_EFL_TEST_RUNTIME_OUTPUT_DIRECTORY})
270         target_link_libraries(${testName} ${EWKUnitTests_LIBRARIES} ewkTestUtils)
271     endforeach ()
272 endif ()
273