Add patch to fix freetype 2.5 detection

This commit is contained in:
Andrey Bondrov 2014-06-03 21:07:11 +11:00
parent 9853b7aad9
commit 61ff1580da
2 changed files with 76 additions and 1 deletions

View file

@ -0,0 +1,74 @@
diff -urN cmake-2.8.11.2/Modules/FindFreetype.cmake cmake-2.8.11.2-patched/Modules/FindFreetype.cmake
--- cmake-2.8.11.2/Modules/FindFreetype.cmake 2013-07-03 00:41:39.000000000 +1100
+++ cmake-2.8.11.2-patched/Modules/FindFreetype.cmake 2014-06-03 21:04:58.520471128 +1100
@@ -1,16 +1,25 @@
-# - Locate FreeType library
+#.rst:
+# FindFreetype
+# ------------
+#
+# Locate FreeType library
+#
# This module defines
-# FREETYPE_LIBRARIES, the library to link against
-# FREETYPE_FOUND, if false, do not try to link to FREETYPE
-# FREETYPE_INCLUDE_DIRS, where to find headers.
-# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
-# This is the concatenation of the paths:
-# FREETYPE_INCLUDE_DIR_ft2build
-# FREETYPE_INCLUDE_DIR_freetype2
-#
-# $FREETYPE_DIR is an environment variable that would
-# correspond to the ./configure --prefix=$FREETYPE_DIR
-# used in building FREETYPE.
+#
+# ::
+#
+# FREETYPE_LIBRARIES, the library to link against
+# FREETYPE_FOUND, if false, do not try to link to FREETYPE
+# FREETYPE_INCLUDE_DIRS, where to find headers.
+# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
+# This is the concatenation of the paths:
+# FREETYPE_INCLUDE_DIR_ft2build
+# FREETYPE_INCLUDE_DIR_freetype2
+#
+#
+#
+# $FREETYPE_DIR is an environment variable that would correspond to the
+# ./configure --prefix=$FREETYPE_DIR used in building FREETYPE.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -53,7 +62,10 @@
PATH_SUFFIXES include/freetype2 include
)
-find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
+find_path(FREETYPE_INCLUDE_DIR_freetype2
+ NAMES
+ freetype/config/ftheader.h
+ config/ftheader.h
HINTS
ENV FREETYPE_DIR
PATHS
@@ -79,11 +91,18 @@
# set the user variables
if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
+ list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS)
endif()
set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
-if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
- file(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
+if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+ set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
+ set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
+endif()
+
+if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
+ file(STRINGS "${FREETYPE_H}" freetype_version_str
REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
unset(FREETYPE_VERSION_STRING)

View file

@ -5,13 +5,14 @@
Summary: Cross-platform, open-source make system
Name: cmake
Version: 2.8.11.2
Release: 2
Release: 3
Epoch: 1
License: BSD
Group: Development/Other
Url: http://www.cmake.org/HTML/index.html
Source0: http://www.cmake.org/files/v%{shortVersion}/%{name}-%{version}.tar.gz
Source1: cmake.macros
Patch0: cmake-2.8.11.2-freetype-2.5.patch
# fix ftlk detection
Patch1: 0001-Fix-FLTK-Find-path.patch
Patch3: 0003-Disable-Test198.patch