Changeset 260427 in webkit


Ignore:
Timestamp:
Apr 21, 2020 8:26:53 AM (4 years ago)
Author:
Adrian Perez de Castro
Message:

[GTK][CMake] Make gtk-unix-print a component of FindGTK.cmake
https://bugs.webkit.org/show_bug.cgi?id=210792

Reviewed by Carlos Garcia Campos.

.:

  • Source/cmake/FindGTK.cmake: Support an "unix-print" component.
  • Source/cmake/FindGTKUnixPrint.cmake: Removed.
  • Source/cmake/OptionsGTK.cmake: Use the "unix-print" component of the GTK find module.

Source/WebKit:

No new tests needed.

  • PlatformGTK.cmake: Use the GTK::UnixPrint imported target.

Tools:

  • TestWebKitAPI/glib/PlatformGTK.cmake: Use the GTK::UnixPrint imported target.
Location:
trunk
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r260356 r260427  
     12020-04-21  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [GTK][CMake] Make gtk-unix-print a component of FindGTK.cmake
     4        https://bugs.webkit.org/show_bug.cgi?id=210792
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * Source/cmake/FindGTK.cmake: Support an "unix-print" component.
     9        * Source/cmake/FindGTKUnixPrint.cmake: Removed.
     10        * Source/cmake/OptionsGTK.cmake: Use the "unix-print" component of the GTK find module.
     11
    1122020-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    213
  • trunk/Source/WebKit/ChangeLog

    r260419 r260427  
     12020-04-21  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [GTK][CMake] Make gtk-unix-print a component of FindGTK.cmake
     4        https://bugs.webkit.org/show_bug.cgi?id=210792
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        No new tests needed.
     9
     10        * PlatformGTK.cmake: Use the GTK::UnixPrint imported target.
     11
    1122020-04-21  Philippe Normand  <pnormand@igalia.com>
    213
  • trunk/Source/WebKit/PlatformGTK.cmake

    r260277 r260427  
    427427    ${GSTREAMER_PBUTILS_INCLUDE_DIRS}
    428428    ${GTK_INCLUDE_DIRS}
    429     ${GTK_UNIX_PRINT_INCLUDE_DIRS}
    430429    ${LIBSOUP_INCLUDE_DIRS}
    431430)
     
    459458list(APPEND GPUProcess_SOURCES
    460459    GPUProcess/EntryPoint/unix/GPUProcessMain.cpp
    461 )
    462 
    463 list(APPEND WebKit_LIBRARIES
    464     ${GTK_UNIX_PRINT_LIBRARIES}
    465460)
    466461
     
    470465      ${WPEBACKEND_FDO_LIBRARIES}
    471466    )
     467endif ()
     468
     469if (GTK_UNIX_PRINT_FOUND)
     470    list(APPEND WebKit_LIBRARIES GTK::UnixPrint)
    472471endif ()
    473472
  • trunk/Source/cmake/FindGTK.cmake

    r259641 r260427  
    3131Find GTK headers and libraries.
    3232
     33Optional Components
     34^^^^^^^^^^^^^^^^^^^
     35
     36The ``COMPONENTS`` (or ``OPTIONAL_COMPONENTS``) keyword can be passed to
     37``find_package()``, the following GTK components can be searched for:
     38
     39- ``unix-print``
     40
     41
    3342Imported Targets
    3443^^^^^^^^^^^^^^^^
     
    3645``GTK::GTK``
    3746  The GTK library, if found.
     47``GTK::UnixPrint``
     48  The GTK unix-print library, if found.
    3849
    3950Result Variables
     
    4455``GTK_FOUND``
    4556  true if (the requested version of) GTK is available.
     57``GTK_UNIX_PRINT_FOUND``
     58  true if the ``unix-print`` component is available.
    4659``GTK_4``
    4760  whether GTK 4 was detected
     
    6982if (GTK_FIND_VERSION VERSION_LESS 3.90)
    7083    set(GTK_PC_MODULE "gtk+-3.0")
     84    set(GTK_PC_UNIX_PRINT_MODULE "gtk+-unix-print-3.0")
    7185    set(GTK_4 FALSE)
    7286    set(GTK_3 TRUE)
    7387else ()
    7488    set(GTK_PC_MODULE "gtk4")
     89    set(GTK_PC_UNIX_PRINT_MODULE "gtk4-unix-print")
    7590    set(GTK_4 TRUE)
    7691    set(GTK_3 FALSE)
     
    116131endif ()
    117132
     133# Try to find additional components
     134foreach (gtk_component ${GTK_FIND_COMPONENTS})
     135    if (NOT "${gtk_component}" STREQUAL unix-print)
     136        message(FATAL_ERROR "Invalid component name: ${gtk_component}")
     137    endif ()
     138    pkg_check_modules(GTK_UNIX_PRINT IMPORTED_TARGET "${GTK_PC_UNIX_PRINT_MODULE}")
     139    if (GTK_FIND_REQUIRED_unix-print AND NOT GTK_UNIX_PRINT_FOUND)
     140        message(FATAL_ERROR "Component unix-print not found")
     141    endif ()
     142    if (TARGET PkgConfig::GTK_UNIX_PRINT AND NOT TARGET GTK::UnixPrint)
     143        add_library(GTK::UnixPrint INTERFACE IMPORTED GLOBAL)
     144        set_property(TARGET GTK::UnixPrint PROPERTY
     145            INTERFACE_LINK_LIBRARIES PkgConfig::GTK_UNIX_PRINT)
     146    endif ()
     147endforeach ()
     148
    118149include(FindPackageHandleStandardArgs)
    119150FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK DEFAULT_MSG GTK_VERSION GTK_VERSION_OK)
  • trunk/Source/cmake/OptionsGTK.cmake

    r260356 r260427  
    3939find_package(LibGcrypt 1.6.0 REQUIRED)
    4040find_package(GLIB 2.44.0 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
    41 find_package(GTK ${GTK_MINIMUM_VERSION} REQUIRED)
     41find_package(GTK ${GTK_MINIMUM_VERSION} REQUIRED OPTIONAL_COMPONENTS unix-print)
    4242find_package(HarfBuzz 0.9.18 REQUIRED COMPONENTS ICU)
    4343find_package(ICU 60.2 REQUIRED COMPONENTS data i18n uc)
     
    5353find_package(ATSPI 2.5.3)
    5454find_package(EGL)
    55 find_package(GTKUnixPrint)
    5655find_package(OpenGL)
    5756find_package(OpenGLES2)
     
    225224add_definitions(-DSVN_REVISION="${SVN_REVISION}")
    226225
    227 SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_UNIX_PRINTING ${GTKUnixPrint_FOUND})
     226SET_AND_EXPOSE_TO_BUILD(HAVE_GTK_UNIX_PRINTING ${GTK_UNIX_PRINT_FOUND})
    228227
    229228if (USE_WPE_RENDERER)
  • trunk/Tools/ChangeLog

    r260426 r260427  
     12020-04-21  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [GTK][CMake] Make gtk-unix-print a component of FindGTK.cmake
     4        https://bugs.webkit.org/show_bug.cgi?id=210792
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * TestWebKitAPI/glib/PlatformGTK.cmake: Use the GTK::UnixPrint imported target.
     9
    1102020-04-21  Philippe Normand  <pnormand@igalia.com>
    211
  • trunk/Tools/TestWebKitAPI/glib/PlatformGTK.cmake

    r259641 r260427  
    1515list(APPEND WebKitGLibAPITests_SYSTEM_INCLUDE_DIRECTORIES
    1616    ${ATSPI_INCLUDE_DIRS}
    17     ${GTK_UNIX_PRINT_INCLUDE_DIRS}
    1817)
    1918
    2019list(APPEND WebKitGLibAPITest_LIBRARIES
    2120    ${ATSPI_LIBRARIES}
    22     ${GTK_UNIX_PRINT_LIBRARIES}
    2321    GTK::GTK
    2422)
     23
     24if (GTK_UNIX_PRINT_FOUND)
     25    list(APPEND WebKitGLibAPITest_LIBRARIES GTK::UnixPrint)
     26endif ()
    2527
    2628list(APPEND WebKitGLibAPIWebProcessTests
Note: See TracChangeset for help on using the changeset viewer.