[CMake] Use builtin FindICU
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 May 2019 02:38:38 +0000 (02:38 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 May 2019 02:38:38 +0000 (02:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197934

Reviewed by Michael Catanzaro.

.:

Update CMake minimum required to 3.7. 3.7 has a FindICU module so the WebKit one
is removed. For non-Apple ports this just requires adding individual components of
ICU to find_package(ICU). For Apple ports the module does not work so the targets
created in FindICU are mirrored in target/icu.cmake.

* CMakeLists.txt:
* Source/cmake/FindICU.cmake: Removed.
* Source/cmake/OptionsAppleWin.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:
* Source/cmake/target/icu.cmake: Added.

Source/JavaScriptCore:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WebCore:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:
* PlatformPlayStation.cmake:
* PlatformWPE.cmake:

Source/WebCore/PAL:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* pal/CMakeLists.txt:

Source/WebDriver:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* PlatformWPE.cmake:

Source/WebKit:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:

Source/WebKitLegacy:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WTF:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
up propagating to all consumers of WTF.

* wtf/CMakeLists.txt:
* wtf/PlatformPlayStation.cmake:

Tools:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* TestWebKitAPI/PlatformMac.cmake:
* TestWebKitAPI/PlatformPlayStation.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* WebKitTestRunner/CMakeLists.txt:

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

36 files changed:
CMakeLists.txt
ChangeLog
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/PlatformWin.cmake
Source/WTF/ChangeLog
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/PlatformPlayStation.cmake
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/CMakeLists.txt
Source/WebCore/PlatformPlayStation.cmake
Source/WebCore/PlatformWPE.cmake
Source/WebDriver/ChangeLog
Source/WebDriver/PlatformWPE.cmake
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKitLegacy/CMakeLists.txt
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/PlatformWin.cmake
Source/cmake/FindICU.cmake [deleted file]
Source/cmake/OptionsAppleWin.cmake
Source/cmake/OptionsGTK.cmake
Source/cmake/OptionsJSCOnly.cmake
Source/cmake/OptionsMac.cmake
Source/cmake/OptionsPlayStation.cmake
Source/cmake/OptionsWPE.cmake
Source/cmake/OptionsWin.cmake
Source/cmake/OptionsWinCairo.cmake
Source/cmake/target/icu.cmake [new file with mode: 0644]
Tools/ChangeLog
Tools/TestWebKitAPI/PlatformMac.cmake
Tools/TestWebKitAPI/PlatformPlayStation.cmake
Tools/TestWebKitAPI/PlatformWin.cmake
Tools/WebKitTestRunner/CMakeLists.txt

index d3e8a23..e79f412 100644 (file)
@@ -2,13 +2,13 @@
 # Determine CMake version and build type.
 # -----------------------------------------------------------------------------
 #
-# NOTE: cmake_minimum_required() and project() *MUST* be the two fist commands
+# NOTE: cmake_minimum_required() and project() *MUST* be the two first commands
 # used, see https://cmake.org/cmake/help/v3.3/command/project.html -- the
 # latter in particular handles loading a bunch of shared CMake definitions
 # and loading the cross-compilation settings from CMAKE_TOOLCHAIN_FILE.
 #
 
-cmake_minimum_required(VERSION 3.3)
+cmake_minimum_required(VERSION 3.7)
 
 project(WebKit)
 
index 0d5cfe4..05f1e22 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2019-05-17  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use builtin FindICU
+        https://bugs.webkit.org/show_bug.cgi?id=197934
+
+        Reviewed by Michael Catanzaro.
+
+        Update CMake minimum required to 3.7. 3.7 has a FindICU module so the WebKit one
+        is removed. For non-Apple ports this just requires adding individual components of
+        ICU to find_package(ICU). For Apple ports the module does not work so the targets
+        created in FindICU are mirrored in target/icu.cmake.
+
+        * CMakeLists.txt:
+        * Source/cmake/FindICU.cmake: Removed.
+        * Source/cmake/OptionsAppleWin.cmake:
+        * Source/cmake/OptionsGTK.cmake:
+        * Source/cmake/OptionsJSCOnly.cmake:
+        * Source/cmake/OptionsMac.cmake:
+        * Source/cmake/OptionsPlayStation.cmake:
+        * Source/cmake/OptionsWPE.cmake:
+        * Source/cmake/OptionsWin.cmake:
+        * Source/cmake/OptionsWinCairo.cmake:
+        * Source/cmake/target/icu.cmake: Added.
+
 2019-05-09  Xan L√≥pez  <xan@igalia.com>
 
         [CMake] Detect SSE2 at compile time
index 5d6d170..e716c71 100644 (file)
@@ -54,10 +54,6 @@ if (USE_CAPSTONE)
     list(APPEND JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/capstone/Source/include")
 endif ()
 
-set(JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES
-    "${ICU_INCLUDE_DIRS}"
-)
-
 set(JavaScriptCore_OBJECT_LUT_SOURCES
     runtime/ArrayConstructor.cpp
     runtime/AsyncFromSyncIteratorPrototype.cpp
@@ -121,7 +117,6 @@ set(JavaScriptCore_OBJECT_LUT_SOURCES
 
 set(JavaScriptCore_LIBRARIES
     WTF${DEBUG_SUFFIX}
-    ${ICU_I18N_LIBRARIES}
 )
 
 if (USE_CAPSTONE)
index 82d5cfe..5511733 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-17  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use builtin FindICU
+        https://bugs.webkit.org/show_bug.cgi?id=197934
+
+        Reviewed by Michael Catanzaro.
+
+        Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
+
+        * CMakeLists.txt:
+        * PlatformWin.cmake:
+
 2019-05-17  Keith Rollin  <krollin@apple.com>
 
         Re-enable generate-xcfilelists
index 425b97e..c7d0ef5 100644 (file)
@@ -27,7 +27,6 @@ endif ()
 
 if (NOT WTF_PLATFORM_WIN_CAIRO)
     list(APPEND JavaScriptCore_LIBRARIES
-        ${ICU_LIBRARIES}
         winmm
     )
 endif ()
index 492d7b0..e63fa88 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-17  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use builtin FindICU
+        https://bugs.webkit.org/show_bug.cgi?id=197934
+
+        Reviewed by Michael Catanzaro.
+
+        Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
+        up propagating to all consumers of WTF.
+
+        * wtf/CMakeLists.txt:
+        * wtf/PlatformPlayStation.cmake:
+
 2019-05-17  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r245418.
index 6d64080..07f501a 100644 (file)
@@ -491,13 +491,11 @@ list(APPEND WTF_SOURCES
 
     unicode/icu/CollatorICU.cpp
 )
-set(WTF_SYSTEM_INCLUDE_DIRECTORIES
-    ${ICU_INCLUDE_DIRS}
-)
+
 list(APPEND WTF_LIBRARIES
-    ${ICU_DATA_LIBRARIES}
-    ${ICU_I18N_LIBRARIES}
-    ${ICU_LIBRARIES}
+    ICU::data
+    ICU::i18n
+    ICU::uc
 )
 
 WEBKIT_FRAMEWORK_DECLARE(WTF)
index 1a524b1..932b2a3 100644 (file)
@@ -17,7 +17,6 @@ list(APPEND WTF_SOURCES
 
 list(APPEND WTF_LIBRARIES
     ${CMAKE_THREAD_LIBS_INIT}
-    ${ICU_LIBRARIES}
 
     ${C_STD_LIBRARY}
     ${KERNEL_LIBRARY}
index fd99e7d..4416f25 100644 (file)
@@ -166,7 +166,6 @@ set(WebCore_PRIVATE_INCLUDE_DIRECTORIES
 )
 
 set(WebCore_SYSTEM_INCLUDE_DIRECTORIES
-    ${ICU_INCLUDE_DIRS}
     ${LIBXML2_INCLUDE_DIR}
     ${LIBXSLT_INCLUDE_DIR}
     ${SQLITE_INCLUDE_DIR}
@@ -1196,7 +1195,6 @@ set(WebCore_PLUG_INS_RESOURCES
 )
 
 set(WebCore_LIBRARIES
-    ${ICU_LIBRARIES}
     ${LIBXML2_LIBRARIES}
     ${LIBXSLT_LIBRARIES}
     ${SQLITE_LIBRARIES}
index b3ce813..2912496 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-17  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use builtin FindICU
+        https://bugs.webkit.org/show_bug.cgi?id=197934
+
+        Reviewed by Michael Catanzaro.
+
+        Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
+
+        * CMakeLists.txt:
+        * PlatformPlayStation.cmake:
+        * PlatformWPE.cmake:
+
 2019-05-17  Alex Christensen  <achristensen@webkit.org>
 
         Enable legacy EME for iOS WKWebView
index 94807af..319be99 100644 (file)
@@ -1,3 +1,14 @@
+2019-05-17  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use builtin FindICU
+        https://bugs.webkit.org/show_bug.cgi?id=197934
+
+        Reviewed by Michael Catanzaro.
+
+        Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
+
+        * pal/CMakeLists.txt:
+
 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
 
         Make LOG_WITH_STREAM more efficient
index c50c485..fc0091e 100644 (file)
@@ -37,10 +37,6 @@ set(PAL_PRIVATE_INCLUDE_DIRECTORIES
     "${PAL_DIR}/pal/text"
 )
 
-set(PAL_SYSTEM_INCLUDE_DIRECTORIES
-    ${ICU_INCLUDE_DIRS}
-)
-
 set(PAL_LIBRARIES
     JavaScriptCore${DEBUG_SUFFIX}
 )
index d1ea46c..7193bc5 100644 (file)
@@ -81,7 +81,6 @@ set(WebCore_USER_AGENT_SCRIPTS
 )
 
 list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
-    ${ICU_INCLUDE_DIRS}
     ${LIBXML2_INCLUDE_DIR}
     ${SQLITE_INCLUDE_DIR}
     ${ZLIB_INCLUDE_DIRS}
@@ -89,7 +88,6 @@ list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
 )
 
 list(APPEND WebCore_LIBRARIES
-    ${ICU_LIBRARIES}
     ${LIBXML2_LIBRARIES}
     ${SQLITE_LIBRARIES}
     ${ZLIB_LIBRARIES}
index 1cad0e6..4100c81 100644 (file)
@@ -52,7 +52,6 @@ list(APPEND WebCore_LIBRARIES
     ${GLIB_GMODULE_LIBRARIES}
     ${GLIB_GOBJECT_LIBRARIES}
     ${GLIB_LIBRARIES}
-    ${ICU_LIBRARIES}
     ${LIBTASN1_LIBRARIES}
     ${UPOWERGLIB_LIBRARIES}
     ${WPE_LIBRARIES}
@@ -61,7 +60,6 @@ list(APPEND WebCore_LIBRARIES
 list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
     ${GIO_UNIX_INCLUDE_DIRS}
     ${GLIB_INCLUDE_DIRS}
-    ${ICU_INCLUDE_DIRS}
     ${LIBTASN1_INCLUDE_DIRS}
     ${UPOWERGLIB_INCLUDE_DIRS}
     ${WPE_INCLUDE_DIRS}
index e38b7bc..4049ce1 100644 (file)
@@ -1,3 +1,14 @@
+2019-05-17  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use builtin FindICU
+        https://bugs.webkit.org/show_bug.cgi?id=197934
+
+        Reviewed by Michael Catanzaro.
+
+        Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
+
+        * PlatformWPE.cmake:
+
 2019-04-14  Don Olmstead  <don.olmstead@sony.com>
 
         [CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
index ba21798..bd3cd81 100644 (file)
@@ -2,7 +2,6 @@ set(WebDriver_Process_OUTPUT_NAME WPEWebDriver)
 
 list(APPEND WebDriver_SYSTEM_INCLUDE_DIRECTORIES
     "${GLIB_INCLUDE_DIRS}"
-    "${ICU_INCLUDE_DIRS}"
     "${LIBSOUP_INCLUDE_DIRS}"
 )
 
index 4b0bec7..310f169 100644 (file)
@@ -98,10 +98,6 @@ set(WebKit_INCLUDE_DIRECTORIES
 
 set(PROTOCOL_GENERATOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
 
-set(WebKit_SYSTEM_INCLUDE_DIRECTORIES
-    ${ICU_INCLUDE_DIRS}
-)
-
 list(APPEND WebKit_UNIFIED_SOURCE_LIST_FILES
     "Sources.txt"
 )
index 7bb8241..fb9d26c 100644 (file)
@@ -1,3 +1,14 @@
+2019-05-17  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use builtin FindICU
+        https://bugs.webkit.org/show_bug.cgi?id=197934
+
+        Reviewed by Michael Catanzaro.
+
+        Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
+
+        * CMakeLists.txt:
+
 2019-05-17  Alex Christensen  <achristensen@webkit.org>
 
         Enable legacy EME for iOS WKWebView
index b0c77dd..960a970 100644 (file)
@@ -25,10 +25,6 @@ set(WebKitLegacy_PRIVATE_INCLUDE_DIRECTORIES
     "${WebKitLegacy_DERIVED_SOURCES_DIR}"
 )
 
-set(WebKitLegacy_SYSTEM_INCLUDE_DIRECTORIES
-    "${ICU_INCLUDE_DIRS}"
-)
-
 set(WebKitLegacy_LIBRARIES
     PRIVATE JavaScriptCore${DEBUG_SUFFIX}
     PRIVATE WebCore${DEBUG_SUFFIX}
index 69790e8..1dd54ea 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-17  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use builtin FindICU
+        https://bugs.webkit.org/show_bug.cgi?id=197934
+
+        Reviewed by Michael Catanzaro.
+
+        Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
+
+        * CMakeLists.txt:
+        * PlatformWin.cmake:
+
 2019-05-03  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r244881.
index 7408928..b405d6d 100644 (file)
@@ -24,8 +24,6 @@ else ()
         PRIVATE CoreText${DEBUG_SUFFIX}
         PRIVATE QuartzCore${DEBUG_SUFFIX}
         PRIVATE libdispatch${DEBUG_SUFFIX}
-        PRIVATE libicuin${DEBUG_SUFFIX}
-        PRIVATE libicuuc${DEBUG_SUFFIX}
         PRIVATE ${LIBXML2_LIBRARIES}
         PRIVATE ${LIBXSLT_LIBRARIES}
         PRIVATE ${SQLITE_LIBRARIES}
diff --git a/Source/cmake/FindICU.cmake b/Source/cmake/FindICU.cmake
deleted file mode 100644 (file)
index f9d79c1..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-# Finds the International Components for Unicode (ICU) Library
-#
-#  ICU_FOUND          - True if ICU found.
-#  ICU_I18N_FOUND     - True if ICU's internationalization library found.
-#  ICU_INCLUDE_DIRS   - Directory to include to get ICU headers
-#                       Note: always include ICU headers as, e.g.,
-#                       unicode/utypes.h
-#  ICU_LIBRARIES      - Libraries to link against for the common ICU
-#  ICU_I18N_LIBRARIES - Libraries to link against for ICU internationaliation
-#                       (note: in addition to ICU_LIBRARIES)
-
-find_package(PkgConfig)
-pkg_check_modules(PC_ICU icu-uc)
-
-# Look for the header file.
-find_path(
-    ICU_INCLUDE_DIR
-    NAMES unicode/utypes.h
-    HINTS ${PC_ICU_INCLUDE_DIRS}
-          ${PC_ICU_INCLUDEDIR}
-          ${WEBKIT_LIBRARIES_INCLUDE_DIR}
-    DOC "Include directory for the ICU library")
-mark_as_advanced(ICU_INCLUDE_DIR)
-
-# Look for the library.
-find_library(
-    ICU_LIBRARY
-    NAMES libicuuc cygicuuc cygicuuc32 icuuc
-    HINTS ${PC_ICU_LIBRARY_DIRS}
-          ${PC_ICU_LIBDIR}
-          ${WEBKIT_LIBRARIES_LINK_DIR}
-    DOC "Libraries to link against for the common parts of ICU")
-mark_as_advanced(ICU_LIBRARY)
-
-# Copy the results to the output variables.
-if (ICU_INCLUDE_DIR AND ICU_LIBRARY)
-    set(ICU_FOUND 1)
-    set(ICU_LIBRARIES ${ICU_LIBRARY})
-    set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
-
-    set(ICU_VERSION 0)
-    set(ICU_MAJOR_VERSION 0)
-    set(ICU_MINOR_VERSION 0)
-    file(READ "${ICU_INCLUDE_DIR}/unicode/uversion.h" _ICU_VERSION_CONENTS)
-    string(REGEX REPLACE ".*#define U_ICU_VERSION_MAJOR_NUM ([0-9]+).*" "\\1" ICU_MAJOR_VERSION "${_ICU_VERSION_CONENTS}")
-    string(REGEX REPLACE ".*#define U_ICU_VERSION_MINOR_NUM ([0-9]+).*" "\\1" ICU_MINOR_VERSION "${_ICU_VERSION_CONENTS}")
-
-    set(ICU_VERSION "${ICU_MAJOR_VERSION}.${ICU_MINOR_VERSION}")
-
-    # Look for the ICU internationalization libraries
-    pkg_check_modules(PC_ICU_I18N icu-i18n)
-    find_library(
-        ICU_I18N_LIBRARY
-        NAMES icui18n libicui18n libicuin cygicuin cygicuin32 icuin
-        HINTS ${PC_ICU_I18N_LIBRARY_DIRS}
-              ${PC_ICU_I18N_LIBDIR}
-              ${WEBKIT_LIBRARIES_LINK_DIR}
-        DOC "Libraries to link against for ICU internationalization")
-    mark_as_advanced(ICU_I18N_LIBRARY)
-    if (ICU_I18N_LIBRARY)
-        set(ICU_I18N_FOUND 1)
-        set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY})
-    else ()
-        set(ICU_I18N_FOUND 0)
-        set(ICU_I18N_LIBRARIES)
-    endif ()
-
-    # Look for the ICU data libraries
-    find_library(
-        ICU_DATA_LIBRARY
-        NAMES icudata libicudata cygicudata cygicudata32
-        HINTS ${PC_ICU_I18N_LIBRARY_DIRS}
-              ${PC_ICU_I18N_LIBDIR}
-              ${WEBKIT_LIBRARIES_LINK_DIR}
-        DOC "Libraries to link against for ICU data")
-    mark_as_advanced(ICU_DATA_LIBRARY)
-    if (ICU_DATA_LIBRARY)
-        set(ICU_DATA_FOUND 1)
-        set(ICU_DATA_LIBRARIES ${ICU_DATA_LIBRARY})
-    else ()
-        set(ICU_DATA_FOUND 0)
-        set(ICU_DATA_LIBRARIES)
-    endif ()
-else ()
-    set(ICU_FOUND 0)
-    set(ICU_I18N_FOUND 0)
-    set(ICU_DATA_FOUND 0)
-    set(ICU_LIBRARIES)
-    set(ICU_I18N_LIBRARIES)
-    set(ICU_DATA_LIBRARIES)
-    set(ICU_INCLUDE_DIRS)
-    set(ICU_VERSION)
-    set(ICU_MAJOR_VERSION)
-    set(ICU_MINOR_VERSION)
-endif ()
-
-if (ICU_FOUND)
-    if (NOT ICU_FIND_QUIETLY)
-        message(STATUS "Found ICU header files in ${ICU_INCLUDE_DIRS}")
-        message(STATUS "Found ICU libraries: ${ICU_LIBRARIES}")
-        message(STATUS "Found ICU internationaliation libraries: ${ICU_I18N_LIBRARIES}")
-        message(STATUS "Found ICU data libraries: ${ICU_DATA_LIBRARIES}")
-    endif ()
-else ()
-    if (ICU_FIND_REQUIRED)
-        message(FATAL_ERROR "Could not find ICU")
-    else ()
-        message(STATUS "Optional package ICU was not found")
-    endif ()
-endif ()
index 83810e4..df132f9 100644 (file)
@@ -17,6 +17,8 @@ set(SQLITE_LIBRARIES SQLite3${DEBUG_SUFFIX})
 set(ZLIB_INCLUDE_DIRS "${WEBKIT_LIBRARIES_DIR}/include/zlib")
 set(ZLIB_LIBRARIES zdll${DEBUG_SUFFIX})
 
+include(target/icu)
+
 # Uncomment the following line to try the Direct2D backend.
 # set(USE_DIRECT2D 1)
 
index d290bef..b21a58f 100644 (file)
@@ -24,7 +24,7 @@ find_package(LibGcrypt 1.6.0 REQUIRED)
 find_package(GTK3 3.6.0 REQUIRED)
 find_package(GDK3 3.6.0 REQUIRED)
 find_package(HarfBuzz 0.9.2 REQUIRED)
-find_package(ICU REQUIRED)
+find_package(ICU REQUIRED COMPONENTS data i18n uc)
 find_package(JPEG REQUIRED)
 find_package(LibSoup 2.42.0 REQUIRED)
 find_package(LibXml2 2.8.0 REQUIRED)
index 2affab7..16b3b25 100644 (file)
@@ -96,9 +96,8 @@ else ()
 endif ()
 
 if (NOT APPLE)
-    find_package(ICU REQUIRED)
+    find_package(ICU REQUIRED COMPONENTS data i18n uc)
 else ()
     add_definitions(-DU_DISABLE_RENAMING=1 -DU_SHOW_CPLUSPLUS_API=0)
-    set(ICU_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/ICU/Headers)
-    set(ICU_LIBRARIES libicucore.dylib)
+    include(target/icu.cmake)
 endif ()
index fc944e1..60f19f9 100644 (file)
@@ -60,5 +60,4 @@ set(WebCore_LIBRARY_TYPE SHARED)
 set(WebCoreTestSupport_LIBRARY_TYPE SHARED)
 
 add_definitions(-DU_DISABLE_RENAMING=1 -DU_SHOW_CPLUSPLUS_API=0)
-set(ICU_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/ICU/Headers)
-set(ICU_LIBRARIES libicucore.dylib)
+include(target/icu.cmake)
index a4e8793..3369af0 100644 (file)
@@ -80,7 +80,7 @@ find_package(EGL REQUIRED)
 find_package(Fontconfig REQUIRED)
 find_package(Freetype REQUIRED)
 find_package(HarfBuzz REQUIRED)
-find_package(ICU REQUIRED)
+find_package(ICU REQUIRED COMPONENTS data i18n uc)
 find_package(JPEG REQUIRED)
 find_package(LibPSL REQUIRED)
 find_package(LibXml2 REQUIRED)
index 5f7f2f6..c71456a 100644 (file)
@@ -17,7 +17,7 @@ find_package(Fontconfig 2.8.0 REQUIRED)
 find_package(Freetype 2.4.2 REQUIRED)
 find_package(GLIB 2.40.0 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
 find_package(HarfBuzz 0.9.18 REQUIRED)
-find_package(ICU REQUIRED)
+find_package(ICU REQUIRED COMPONENTS data i18n uc)
 find_package(JPEG REQUIRED)
 find_package(LibEpoxy 1.4.0 REQUIRED)
 find_package(LibGcrypt 1.6.0 REQUIRED)
index b6c1386..3e8f769 100644 (file)
@@ -164,8 +164,6 @@ if (NOT ENABLE_UNIFIED_BUILDS AND WebCore_LIBRARY_TYPE MATCHES STATIC)
     set(WebCore_LIBRARY_TYPE OBJECT)
 endif ()
 
-find_package(ICU REQUIRED)
-
 # If <winsock2.h> is not included before <windows.h> redefinition errors occur
 # unless _WINSOCKAPI_ is defined before <windows.h> is included
 add_definitions(-D_WINSOCKAPI_=)
index a716ec6..0fbad95 100644 (file)
@@ -4,6 +4,7 @@ include(OptionsWin)
 
 find_package(Cairo 1.15.12 REQUIRED)
 find_package(CURL 7.60.0 REQUIRED)
+find_package(ICU REQUIRED COMPONENTS data i18n uc)
 find_package(JPEG 1.5.2 REQUIRED)
 find_package(LibXml2 2.9.7 REQUIRED)
 find_package(OpenSSL 2.0.0 REQUIRED)
diff --git a/Source/cmake/target/icu.cmake b/Source/cmake/target/icu.cmake
new file mode 100644 (file)
index 0000000..092eba5
--- /dev/null
@@ -0,0 +1,48 @@
+# Apple ports provide their own ICU that can't be found by find_package(ICU).
+# This file will create targets that would be created by find_package(ICU).
+if (NOT TARGET ICU::data)
+    if (APPLE)
+        set(ICU_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/ICU/Headers)
+
+        # Apple just has a single dylib for ICU
+        set(ICU_I18N_LIBRARY libicucore.dylib)
+        set(ICU_UC_LIBRARY libicucore.dylib)
+        set(ICU_DATA_LIBRARY libicucore.dylib)
+
+        set(ICU_LIBRARIES ${ICU_UC_LIBRARY})
+    elseif (WIN32 AND NOT WTF_PLATFORM_WIN_CAIRO)
+        set(ICU_INCLUDE_DIRS ${WEBKIT_LIBRARIES_INCLUDE_DIR})
+
+        set(ICU_I18N_LIBRARY ${WEBKIT_LIBRARIES_LINK_DIR}/libicuin${DEBUG_SUFFIX}.lib)
+        set(ICU_UC_LIBRARY ${WEBKIT_LIBRARIES_LINK_DIR}/libicuuc${DEBUG_SUFFIX}.lib)
+
+        # AppleWin does not provide a separate data library
+        set(ICU_DATA_LIBRARY ${ICU_UC_LIBRARY})
+
+        set(ICU_LIBRARIES ${ICU_I18N_LIBRARY} ${ICU_UC_LIBRARY})
+    else ()
+        message(FATAL_ERROR "Could not find ICU targets. Use find_package(ICU REQUIRED data i1n8 uc)")
+    endif ()
+
+    # Emulate ICU:: targets
+    add_library(ICU::data UNKNOWN IMPORTED)
+    set_target_properties(ICU::data PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIRS}"
+        IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+        IMPORTED_LOCATION "${ICU_DATA_LIBRARY}"
+    )
+
+    add_library(ICU::i18n UNKNOWN IMPORTED)
+    set_target_properties(ICU::i18n PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIRS}"
+        IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+        IMPORTED_LOCATION "${ICU_I18N_LIBRARY}"
+    )
+
+    add_library(ICU::uc UNKNOWN IMPORTED)
+    set_target_properties(ICU::uc PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIRS}"
+        IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+        IMPORTED_LOCATION "${ICU_UC_LIBRARY}"
+    )
+endif ()
index 8a0c4e8..7a9ef1c 100644 (file)
@@ -1,3 +1,17 @@
+2019-05-17  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Use builtin FindICU
+        https://bugs.webkit.org/show_bug.cgi?id=197934
+
+        Reviewed by Michael Catanzaro.
+
+        Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
+
+        * TestWebKitAPI/PlatformMac.cmake:
+        * TestWebKitAPI/PlatformPlayStation.cmake:
+        * TestWebKitAPI/PlatformWin.cmake:
+        * WebKitTestRunner/CMakeLists.txt:
+
 2019-05-17  Alex Christensen  <achristensen@webkit.org>
 
         Enable legacy EME for iOS WKWebView
index 4e295d6..38925dc 100644 (file)
@@ -17,7 +17,6 @@ list(APPEND test_wtf_LIBRARIES
     ${CARBON_LIBRARY}
     ${COCOA_LIBRARY}
     ${COREFOUNDATION_LIBRARY}
-    ${ICU_LIBRARIES}
 )
 
 list(APPEND TestWebKitAPI_LIBRARIES
index abb8690..952d043 100644 (file)
@@ -10,10 +10,6 @@ list(APPEND TestWTF_SOURCES
     generic/UtilitiesGeneric.cpp
 )
 
-list(APPEND TestWTF_PRIVATE_INCLUDE_DIRECTORIES
-    ${ICU_INCLUDE_DIRS}
-)
-
 list(APPEND TestWebCore_SOURCES
     ${test_main_SOURCES}
 )
index 651ea15..4aa7cd9 100644 (file)
@@ -78,8 +78,6 @@ else ()
         WebKitQuartzCoreAdditions${DEBUG_SUFFIX}
         libdispatch${DEBUG_SUFFIX}
         libexslt${DEBUG_SUFFIX}
-        libicuin${DEBUG_SUFFIX}
-        libicuuc${DEBUG_SUFFIX}
     )
 endif ()
 
index 34ff64a..632aa0b 100644 (file)
@@ -51,7 +51,6 @@ set(WebKitTestRunner_INCLUDE_DIRECTORIES
 
 set(WebKitTestRunner_SYSTEM_INCLUDE_DIRECTORIES
     ${LIBSOUP_INCLUDE_DIRS}
-    ${ICU_INCLUDE_DIRS}
 )
 
 set(WebKitTestRunnerInjectedBundle_SOURCES