Merge topic 'FindFreetype-2.5'
9b08e3f
FindFreetype: Remove duplicates in FREETYPE_INCLUDE_DIRSbc49d82
FindFreetype: Detect version string with Freetype 2.57435ae7
FindFreetype: Find ftheader.h with Freetype 2.5
This commit is contained in:
commit
172f37be33
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue