[EFL][GTK] Get CMake to find Freetype2 properly
authorthiago.lacerda@openbossa.org <thiago.lacerda@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Mar 2014 14:19:00 +0000 (14:19 +0000)
committerthiago.lacerda@openbossa.org <thiago.lacerda@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Mar 2014 14:19:00 +0000 (14:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130150

Reviewed by Csaba Osztrogonác.

Newer versions of CMake are not able to find Freetype2 correctly.
FindFreetype2.cmake checks for the version number in freetype.h header, since it seems that bug exists in
freetype2 repo, because a completely different version number is found in freetype2.pc.

.:

* Source/cmake/FindFreetype2.cmake: Added.
* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

* PlatformEfl.cmake:
* PlatformGTK.cmake:

Source/WebKit:

* PlatformEfl.cmake:

Source/WebKit2:

* PlatformEfl.cmake:

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

ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebCore/PlatformGTK.cmake
Source/WebKit/ChangeLog
Source/WebKit/PlatformEfl.cmake
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/cmake/FindFreetype2.cmake [new file with mode: 0644]
Source/cmake/OptionsEfl.cmake
Source/cmake/OptionsGTK.cmake

index d4674bf..23d2ad0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2014-03-20  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
+
+        [EFL][GTK] Get CMake to find Freetype2 properly
+        https://bugs.webkit.org/show_bug.cgi?id=130150
+
+        Reviewed by Csaba Osztrogonác.
+
+        Newer versions of CMake are not able to find Freetype2 correctly.
+        FindFreetype2.cmake checks for the version number in freetype.h header, since it seems that bug exists in
+        freetype2 repo, because a completely different version number is found in freetype2.pc.
+
+        * Source/cmake/FindFreetype2.cmake: Added.
+        * Source/cmake/OptionsEfl.cmake:
+        * Source/cmake/OptionsGTK.cmake:
+
 2014-03-17  Brendan Long  <b.long@cablelabs.com>
 
         [GStreamer] human readable language code for tracks
index 44ac8ab..26bd798 100644 (file)
@@ -1,3 +1,17 @@
+2014-03-20  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
+
+        [EFL][GTK] Get CMake to find Freetype2 properly
+        https://bugs.webkit.org/show_bug.cgi?id=130150
+
+        Reviewed by Csaba Osztrogonác.
+
+        Newer versions of CMake are not able to find Freetype2 correctly.
+        FindFreetype2.cmake checks for the version number in freetype.h header, since it seems that bug exists in
+        freetype2 repo, because a completely different version number is found in freetype2.pc.
+
+        * PlatformEfl.cmake:
+        * PlatformGTK.cmake:
+
 2014-03-20  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
 
         Refactor checking log channel state in MediaPlayerPrivateGStreamerBase.
index 1886917..149d09b 100644 (file)
@@ -221,7 +221,7 @@ list(APPEND WebCore_LIBRARIES
     ${E_DBUS_EUKIT_LIBRARIES}
     ${E_DBUS_LIBRARIES}
     ${FONTCONFIG_LIBRARIES}
-    ${FREETYPE_LIBRARIES}
+    ${FREETYPE2_LIBRARIES}
     ${GLIB_GIO_LIBRARIES}
     ${GLIB_GOBJECT_LIBRARIES}
     ${GLIB_LIBRARIES}
@@ -248,7 +248,7 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
     ${EEZE_INCLUDE_DIRS}
     ${EINA_INCLUDE_DIRS}
     ${EVAS_INCLUDE_DIRS}
-    ${FREETYPE_INCLUDE_DIRS}
+    ${FREETYPE2_INCLUDE_DIRS}
     ${LIBXML2_INCLUDE_DIR}
     ${LIBXSLT_INCLUDE_DIR}
     ${SQLITE_INCLUDE_DIR}
index 50cd5d3..5212167 100644 (file)
@@ -294,7 +294,7 @@ list(APPEND WebCore_LIBRARIES
     ${CAIRO_LIBRARIES}
     ${ENCHANT_LIBRARIES}
     ${FONTCONFIG_LIBRARIES}
-    ${FREETYPE_LIBRARIES}
+    ${FREETYPE2_LIBRARIES}
     ${GEOCLUE_LIBRARIES}
     ${GLIB_GIO_LIBRARIES}
     ${GLIB_GMODULE_LIBRARIES}
@@ -323,7 +323,7 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
     ${ATK_INCLUDE_DIRS}
     ${CAIRO_INCLUDE_DIRS}
     ${ENCHANT_INCLUDE_DIRS}
-    ${FREETYPE_INCLUDE_DIRS}
+    ${FREETYPE2_INCLUDE_DIRS}
     ${GEOCLUE_INCLUDE_DIRS}
     ${GIO_UNIX_INCLUDE_DIRS}
     ${GLIB_INCLUDE_DIRS}
index b3c5c1c..bc7b100 100644 (file)
@@ -1,3 +1,16 @@
+2014-03-20  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
+
+        [EFL][GTK] Get CMake to find Freetype2 properly
+        https://bugs.webkit.org/show_bug.cgi?id=130150
+
+        Reviewed by Csaba Osztrogonác.
+
+        Newer versions of CMake are not able to find Freetype2 correctly.
+        FindFreetype2.cmake checks for the version number in freetype.h header, since it seems that bug exists in
+        freetype2 repo, because a completely different version number is found in freetype2.pc.
+
+        * PlatformEfl.cmake:
+
 2014-03-18  Samuel White  <samuel_white@apple.com>
 
         AX: Not able to use arrow keys to read text with VoiceOver before selection is set someplace (anyplace).
index 139661a..37f05e1 100644 (file)
@@ -149,7 +149,7 @@ list(APPEND WebKit_LIBRARIES
     ${EO_LIBRARIES}
     ${EVAS_LIBRARIES}
     ${FONTCONFIG_LIBRARIES}
-    ${FREETYPE_LIBRARIES}
+    ${FREETYPE2_LIBRARIES}
     ${GLIB_GOBJECT_LIBRARIES}
     ${GLIB_LIBRARIES}
     ${HARFBUZZ_LIBRARIES}
index 06d3b8e..2722fda 100644 (file)
@@ -1,3 +1,16 @@
+2014-03-20  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
+
+        [EFL][GTK] Get CMake to find Freetype2 properly
+        https://bugs.webkit.org/show_bug.cgi?id=130150
+
+        Reviewed by Csaba Osztrogonác.
+
+        Newer versions of CMake are not able to find Freetype2 correctly.
+        FindFreetype2.cmake checks for the version number in freetype.h header, since it seems that bug exists in
+        freetype2 repo, because a completely different version number is found in freetype2.pc.
+
+        * PlatformEfl.cmake:
+
 2014-03-20  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL][WK2] test_ewk2_application_cache_manager is flaky
index 2e4ccb7..42498ab 100644 (file)
@@ -278,7 +278,7 @@ list(APPEND WebKit2_LIBRARIES
     ${EO_LIBRARIES}
     ${EVAS_LIBRARIES}
     ${FONTCONFIG_LIBRARIES}
-    ${Freetype_LIBRARIES}
+    ${FREETYPE2_LIBRARIES}
     ${GLIB_GIO_LIBRARIES}
     ${GLIB_GOBJECT_LIBRARIES}
     ${GLIB_LIBRARIES}
diff --git a/Source/cmake/FindFreetype2.cmake b/Source/cmake/FindFreetype2.cmake
new file mode 100644 (file)
index 0000000..2ea1f87
--- /dev/null
@@ -0,0 +1,86 @@
+# Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+#
+# 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 HOLDERS ``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 HOLDERS OR
+# 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(PC_FREETYPE2 REQUIRED freetype2)
+
+find_path(FREETYPE2_HEADER_DIR
+    NAMES freetype.h
+    HINTS ${PC_FREETYPE2_INCLUDE_DIRS}
+          ${PC_FREETYPE2_INCLUDEDIR}
+    PATH_SUFFIXES freetype
+)
+
+find_path(FREETYPE2_ROOT_INCLUDE_DIR
+    NAMES freetype/freetype.h
+    HINTS ${PC_FREETYPE2_INCLUDE_DIRS}
+          ${PC_FREETYPE2_INCLUDEDIR}
+)
+
+find_library(FREETYPE2_LIBRARIES
+    NAMES freetype
+    HINTS ${PC_FREETYPE2_LIBDIR}
+          ${PC_FREETYPE2_LIBRARY_DIRS}
+)
+
+set(FREETYPE2_INCLUDE_DIRS
+    ${FREETYPE2_HEADER_DIR}
+    ${FREETYPE2_ROOT_INCLUDE_DIR}
+)
+
+# Inspired in the original FindFreetype.cmake
+if (FREETYPE2_HEADER_DIR AND EXISTS "${FREETYPE2_HEADER_DIR}/freetype.h")
+    file(STRINGS "${FREETYPE2_HEADER_DIR}/freetype.h" freetype_version_str
+         REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
+
+    unset(FREETYPE2_VERSION_STRING)
+    foreach (VPART MAJOR MINOR PATCH)
+        foreach (VLINE ${freetype_version_str})
+            if (VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
+                string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
+                       FREETYPE2_VERSION_PART "${VLINE}")
+                if (FREETYPE2_VERSION_STRING)
+                    set(FREETYPE2_VERSION_STRING "${FREETYPE2_VERSION_STRING}.${FREETYPE2_VERSION_PART}")
+                else ()
+                    set(FREETYPE2_VERSION_STRING "${FREETYPE2_VERSION_PART}")
+                endif ()
+                unset(FREETYPE2_VERSION_PART)
+            endif ()
+        endforeach ()
+    endforeach ()
+endif ()
+
+set(VERSION_OK TRUE)
+if (FREETYPE2_VERSION_STRING)
+    if (PC_FREETYPE2_FIND_VERSION_EXACT)
+        if (NOT("${Freetype2_FIND_VERSION}" VERSION_EQUAL "${FREETYPE2_VERSION_STRING}"))
+            set(VERSION_OK FALSE)
+        endif ()
+    else ()
+        if ("${FREETYPE2_VERSION_STRING}" VERSION_LESS "${Freetype2_FIND_VERSION}")
+            set(VERSION_OK FALSE)
+        endif ()
+    endif ()
+endif ()
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype2 DEFAULT_MSG FREETYPE2_INCLUDE_DIRS FREETYPE2_LIBRARIES VERSION_OK)
index 0b61d07..66ee6be 100644 (file)
@@ -159,7 +159,7 @@ find_package(Eet ${EFL_REQUIRED_VERSION} REQUIRED ${EFL_CONFIG_MODE})
 find_package(Eeze ${EFL_REQUIRED_VERSION} REQUIRED ${EFL_CONFIG_MODE})
 find_package(Efreet ${EFL_REQUIRED_VERSION} REQUIRED ${EFL_CONFIG_MODE})
 
-find_package(Freetype 2.4.2 REQUIRED)
+find_package(Freetype2 2.4.11 REQUIRED)
 find_package(HarfBuzz 0.9.2 REQUIRED)
 add_definitions(-DWTF_USE_FREETYPE=1)
 add_definitions(-DWTF_USE_HARFBUZZ=1)
index dd1fc5e..f78c96e 100644 (file)
@@ -170,7 +170,7 @@ add_definitions(-DMOZ_X11)
 
 find_package(Cairo 1.10.2 REQUIRED)
 find_package(Fontconfig 2.8.0 REQUIRED)
-find_package(Freetype 2.4.2 REQUIRED)
+find_package(Freetype2 2.4.11 REQUIRED)
 find_package(GTK2 2.24.10 REQUIRED)
 find_package(GDK2 2.24.10 REQUIRED)
 find_package(HarfBuzz 0.9.2 REQUIRED)