[GTK] Be able to disable gtk2 dependency
[WebKit-https.git] / Source / cmake / OptionsGTK.cmake
index 9765b07..4f2bc5a 100644 (file)
@@ -29,8 +29,6 @@ set(WEBKITGTK_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/webkitgtk-${WEBKIT
 find_package(Cairo 1.10.2 REQUIRED)
 find_package(Fontconfig 2.8.0 REQUIRED)
 find_package(Freetype2 2.4.2 REQUIRED)
-find_package(GTK2 2.24.10 REQUIRED)
-find_package(GDK2 2.24.10 REQUIRED)
 find_package(HarfBuzz 0.9.2 REQUIRED)
 find_package(ICU REQUIRED)
 find_package(JPEG REQUIRED)
@@ -59,6 +57,8 @@ if (ENABLE_X11_TARGET)
 endif ()
 
 WEBKIT_OPTION_BEGIN()
+WEBKIT_OPTION_DEFINE(ENABLE_PLUGIN_PROCESS_GTK2 "Whether to build WebKitPluginProcess2 to load GTK2 based plugins." ON)
+
 if (OPENGL_FOUND AND (GLX_FOUND OR EGL_FOUND))
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL ON)
 
@@ -152,6 +152,12 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_PROCESS ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(WTF_USE_TILED_BACKING_STORE OFF)
 WEBKIT_OPTION_END()
 
+if (ENABLE_PLUGIN_PROCESS_GTK2)
+    find_package(GTK2 2.24.10 REQUIRED)
+    find_package(GDK2 2.24.10 REQUIRED)
+    add_definitions(-DENABLE_PLUGIN_PROCESS_GTK2=1)
+endif ()
+
 if (ENABLE_X11_TARGET)
     add_definitions(-DWTF_PLATFORM_X11=1)
     add_definitions(-DMOZ_X11=1)