[GTK][CMake] Ensure that HAVE_GTK_UNIX_PRINTING is defined when appropriate
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Mar 2014 16:40:27 +0000 (16:40 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Mar 2014 16:40:27 +0000 (16:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130155

Reviewed by Philippe Normand.

.:

* Source/cmake/FindGTKUnixPrint.cmake: Added.
* Source/cmake/OptionsGTK.cmake: Look for gtk+-unix-print and use it to turn on HAVE_GTK_UNIX_PRINTING.
* Source/cmakeconfig.h.cmake: Add the HAVE_GTK_UNIX_PRINTING define.

Source/WebKit2:

* PlatformGTK.cmake: Add GTK_UNIX_PRINT flags to the build.

Tools:

* TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt: Add GTK_UNIX_PRINT flags to the build.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165737 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformGTK.cmake
Source/cmake/FindGTKUnixPrint.cmake [new file with mode: 0644]
Source/cmake/OptionsGTK.cmake
Source/cmakeconfig.h.cmake
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt

index 834d082..0d25c4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2014-03-17  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK][CMake] Ensure that HAVE_GTK_UNIX_PRINTING is defined when appropriate
+        https://bugs.webkit.org/show_bug.cgi?id=130155
+
+        Reviewed by Philippe Normand.
+
+        * Source/cmake/FindGTKUnixPrint.cmake: Added.
+        * Source/cmake/OptionsGTK.cmake: Look for gtk+-unix-print and use it to turn on HAVE_GTK_UNIX_PRINTING.
+        * Source/cmakeconfig.h.cmake: Add the HAVE_GTK_UNIX_PRINTING define.
+
 2014-03-16  Kim Byung Jun  <bj1987.kim@samsung.com>
 
         [EFL] Enable TOUCH_SLIDER macro.
index 0b631d2..0ced507 100644 (file)
@@ -1,3 +1,12 @@
+2014-03-17  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK][CMake] Ensure that HAVE_GTK_UNIX_PRINTING is defined when appropriate
+        https://bugs.webkit.org/show_bug.cgi?id=130155
+
+        Reviewed by Philippe Normand.
+
+        * PlatformGTK.cmake: Add GTK_UNIX_PRINT flags to the build.
+
 2014-03-17  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL][WK2] Restore cursor when moving mouse into webview
index ddafd99..7f06e15 100644 (file)
@@ -439,6 +439,7 @@ set(WebKit2CommonIncludeDirectories ${WebKit2_INCLUDE_DIRECTORIES})
 list(APPEND WebKit2_INCLUDE_DIRECTORIES
     ${GLIB_INCLUDE_DIRS}
     ${GTK_INCLUDE_DIRS}
+    ${GTK_UNIX_PRINT_INCLUDE_DIRS}
 )
 
 list(APPEND WebProcess_SOURCES
@@ -453,11 +454,10 @@ set(SharedWebKit2Libraries
     ${WebKit2_LIBRARIES}
 )
 
-# Since the GObjectDOMBindings convenience library exports API that is unused except
-# in embedding applications we need to instruct the linker to link all symbols explicitly.
 list(APPEND WebKit2_LIBRARIES
     GObjectDOMBindings
     WebCorePlatformGTK
+    ${GTK_UNIX_PRINT_LIBRARIES}
 )
 ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
 
diff --git a/Source/cmake/FindGTKUnixPrint.cmake b/Source/cmake/FindGTKUnixPrint.cmake
new file mode 100644 (file)
index 0000000..de3b3eb
--- /dev/null
@@ -0,0 +1,49 @@
+# - Try to find gtk-unix-print
+# Once done, this will define
+#
+#  GTK_UNIX_PRINT_FOUND - system has gtk-unix-print
+#  GTK_UNIX_PRINT_INCLUDE_DIRS - the gtk-unix-print include directories
+#  GTK_UNIX_PRINT_LIBRARIES - link these to use gtk-unix-print
+#
+# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
+# Copyright (C) 2014 Igalia S.L.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
+# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+find_package(PkgConfig)
+pkg_check_modules(GTK_UNIX_PRINT gtk+-unix-print-3.0)
+
+set(VERSION_OK TRUE)
+if (GTK_UNIX_PRINT_VERSION)
+    if (GTK_UNIX_PRINT_FIND_VERSION_EXACT)
+        if (NOT("${GTK_UNIX_PRINT_FIND_VERSION}" VERSION_EQUAL "${GTK_UNIX_PRINT_VERSION}"))
+            set(VERSION_OK FALSE)
+        endif ()
+    else ()
+        if ("${GTK_UNIX_PRINT_VERSION}" VERSION_LESS "${GTK_UNIX_PRINT_FIND_VERSION}")
+            set(VERSION_OK FALSE)
+        endif ()
+    endif ()
+endif ()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK_UNIX_PRINT DEFAULT_MSG GTK_UNIX_PRINT_INCLUDE_DIRS GTK_UNIX_PRINT_LIBRARIES VERSION_OK)
index 32393cd..f0da9b9 100644 (file)
@@ -214,6 +214,11 @@ if (ENABLE_GEOLOCATION)
     endif ()
 endif ()
 
+find_package(GTKUnixPrint)
+if (GTK_UNIX_PRINTING_FOUND)
+    set(HAVE_GTK_UNIX_PRINTING)
+endif ()
+
 # We don't use find_package for GLX because it is part of -lGL, unlike EGL.
 find_package(OpenGL)
 check_include_files("GL/glx.h" GLX_FOUND)
index 13005ec..1f4f145 100644 (file)
 #cmakedefine01 WTF_USE_GEOCLUE2
 #cmakedefine01 WTF_USE_TILED_BACKING_STORE
 #cmakedefine01 HAVE_LLVM
+#cmakedefine01 HAVE_GTK_UNIX_PRINTING
 
 #if defined(BUILDING_GTK__) && !defined(GTK_API_VERSION_2)
 #define GDK_VERSION_MIN_REQUIRED @GDK_VERSION_MIN_REQUIRED@
index 34787fa..1c8d4de 100644 (file)
@@ -1,3 +1,12 @@
+2014-03-17  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK][CMake] Ensure that HAVE_GTK_UNIX_PRINTING is defined when appropriate
+        https://bugs.webkit.org/show_bug.cgi?id=130155
+
+        Reviewed by Philippe Normand.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt: Add GTK_UNIX_PRINT flags to the build.
+
 2014-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] MiniBrowser fails to load injected bundle lib
index 940ed73..eeb15ea 100644 (file)
@@ -24,6 +24,7 @@ include_directories(
     ${ATSPI_INCLUDE_DIRS}
     ${GLIB_INCLUDE_DIRS}
     ${GTK3_INCLUDE_DIRS}
+    ${GTK_UNIX_PRINT_INCLUDE_DIRS}
     ${LIBSOUP_INCLUDE_DIRS}
 )
 
@@ -72,6 +73,7 @@ macro(ADD_WK2_TEST test_name)
         ${ATSPI_LIBRARIES}
         ${GLIB_LIBRARIES}
         ${GTK3_LIBRARIES}
+        ${GTK_UNIX_PRINT_LIBRARIES}
         ${LIBSOUP_LIBRARIES}
     )
     set_target_properties(${test_name} PROPERTIES