diff options
author | Daniele E. Domenichelli <daniele.domenichelli@iit.it> | 2013-12-09 18:33:42 (GMT) |
---|---|---|
committer | Daniele E. Domenichelli <daniele.domenichelli@iit.it> | 2013-12-09 18:33:42 (GMT) |
commit | bc49d820a276243324003bc34d92a69194938adf (patch) | |
tree | 2b6f2ea54092b7c34ad6bf7a430fb29db4486076 /Modules/FindFreetype.cmake | |
parent | 7435ae7c97590a0713d86b63add761d5e1607ec1 (diff) | |
download | CMake-bc49d820a276243324003bc34d92a69194938adf.zip CMake-bc49d820a276243324003bc34d92a69194938adf.tar.gz CMake-bc49d820a276243324003bc34d92a69194938adf.tar.bz2 |
FindFreetype: Detect version string with Freetype 2.5
Diffstat (limited to 'Modules/FindFreetype.cmake')
-rw-r--r-- | Modules/FindFreetype.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 9520f7d..1f12ba6 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) |