SHA256
3
0
forked from pool/cmake
cmake/fix-check-for-freetype251.patch
2013-12-09 09:19:20 +00:00

41 lines
1.5 KiB
Diff

diff -Naur cmake-2.8.12.1.orig/Modules/FindFreetype.cmake cmake-2.8.12.1/Modules/FindFreetype.cmake
--- cmake-2.8.12.1.orig/Modules/FindFreetype.cmake 2013-11-05 20:07:22.000000000 +0100
+++ cmake-2.8.12.1/Modules/FindFreetype.cmake 2013-12-09 01:12:02.967856671 +0100
@@ -70,6 +70,19 @@
PATH_SUFFIXES include/freetype2 include
)
+if(NOT FREETYPE_INCLUDE_DIR_freetype2)
+ find_path(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h
+ HINTS
+ ENV FREETYPE_DIR
+ PATHS
+ /usr/X11R6
+ /usr/local/X11R6
+ /usr/local/X11
+ /usr/freeware
+ PATH_SUFFIXES include/freetype2 include
+ )
+endif()
+
find_library(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
HINTS
@@ -91,8 +104,14 @@
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)