From 7435ae7c97590a0713d86b63add761d5e1607ec1 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 9 Dec 2013 13:24:28 +0100 Subject: [PATCH 1/3] FindFreetype: Find ftheader.h with Freetype 2.5 --- Modules/FindFreetype.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 179dc0004..9520f7d9d 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -65,7 +65,10 @@ find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h 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 From bc49d820a276243324003bc34d92a69194938adf Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 9 Dec 2013 19:33:42 +0100 Subject: [PATCH 2/3] FindFreetype: Detect version string with Freetype 2.5 --- Modules/FindFreetype.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 9520f7d9d..1f12ba654 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -103,8 +103,14 @@ if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) 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) From 9b08e3f5993eb004e3eb0d9ae8b593f553989f89 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 9 Dec 2013 19:39:23 +0100 Subject: [PATCH 3/3] FindFreetype: Remove duplicates in FREETYPE_INCLUDE_DIRS In Freetype 2.5 the paths for FREETYPE_INCLUDE_DIR_ft2build and FREETYPE_INCLUDE_DIR_freetype2 are the same --- Modules/FindFreetype.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 1f12ba654..6f03c86b7 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -100,6 +100,7 @@ find_library(FREETYPE_LIBRARY # 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}")