FindFreetype: Detect version string with Freetype 2.5

This commit is contained in:
Daniele E. Domenichelli 2013-12-09 19:33:42 +01:00
parent 7435ae7c97
commit bc49d820a2
1 changed files with 8 additions and 2 deletions

View File

@ -103,8 +103,14 @@ if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
endif() endif()
set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
file(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str 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]+$") REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
unset(FREETYPE_VERSION_STRING) unset(FREETYPE_VERSION_STRING)