summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-12-19 15:12:25 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-12-19 15:12:25 (GMT)
commit172f37be335cc0c7b6113f7b7708bb4aa00b9ac5 (patch)
treec542df1d87aa6ab830f233dce4181fa86a50ad91 /Modules
parentb891af92908fbbe66dadb9ceebc660156a3c1614 (diff)
parent9b08e3f5993eb004e3eb0d9ae8b593f553989f89 (diff)
downloadCMake-172f37be335cc0c7b6113f7b7708bb4aa00b9ac5.zip
CMake-172f37be335cc0c7b6113f7b7708bb4aa00b9ac5.tar.gz
CMake-172f37be335cc0c7b6113f7b7708bb4aa00b9ac5.tar.bz2
Merge topic 'FindFreetype-2.5'
9b08e3f FindFreetype: Remove duplicates in FREETYPE_INCLUDE_DIRS bc49d82 FindFreetype: Detect version string with Freetype 2.5 7435ae7 FindFreetype: Find ftheader.h with Freetype 2.5
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindFreetype.cmake16
1 files changed, 13 insertions, 3 deletions
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 179dc00..6f03c86 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
@@ -97,11 +100,18 @@ 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}")
-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)