diff options
author | Brad King <brad.king@kitware.com> | 2014-05-28 16:34:35 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-05-28 16:34:35 (GMT) |
commit | ca2b012cb9dd488b74871bf481b1bb9154fdf804 (patch) | |
tree | d349044eddc78cb7f68ab3b78aea5671fd98fa9c /Modules | |
parent | c8c359bb0ff3ed043edd1318bde851ffa894b5e9 (diff) | |
parent | 58f7baab146cda9e11976d8362b8476d8ee5f264 (diff) | |
download | CMake-ca2b012cb9dd488b74871bf481b1bb9154fdf804.zip CMake-ca2b012cb9dd488b74871bf481b1bb9154fdf804.tar.gz CMake-ca2b012cb9dd488b74871bf481b1bb9154fdf804.tar.bz2 |
Merge topic 'FindFreetype-updates'
58f7baab FindFreetype: Indent with 2 spaces instead of 4
444f8801 FindFreetype: Use lower-case name in call to FPHSA
836a28d5 FindFreetype: Move PATH_SUFFIXES argument for more consistency
4ad6dace FindFreetype: Add newlines to reduce code width
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindFreetype.cmake | 73 |
1 files changed, 48 insertions, 25 deletions
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 1779b78..7d46d15 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -51,7 +51,9 @@ # wants explicit full paths and this trickery doesn't work too well. # I'm going to attempt to cut out the middleman and hope # everything still works. -find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h +find_path( + FREETYPE_INCLUDE_DIR_ft2build + ft2build.h HINTS ENV FREETYPE_DIR PATHS @@ -62,10 +64,14 @@ find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h ENV GTKMM_BASEPATH [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] - PATH_SUFFIXES include/freetype2 include freetype2 + PATH_SUFFIXES + include/freetype2 + include + freetype2 ) -find_path(FREETYPE_INCLUDE_DIR_freetype2 +find_path( + FREETYPE_INCLUDE_DIR_freetype2 NAMES freetype/config/ftheader.h config/ftheader.h @@ -79,14 +85,19 @@ find_path(FREETYPE_INCLUDE_DIR_freetype2 ENV GTKMM_BASEPATH [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] - PATH_SUFFIXES include/freetype2 include freetype2 + PATH_SUFFIXES + include/freetype2 + include + freetype2 ) find_library(FREETYPE_LIBRARY - NAMES freetype libfreetype freetype219 + NAMES + freetype + libfreetype + freetype219 HINTS ENV FREETYPE_DIR - PATH_SUFFIXES lib PATHS /usr/X11R6 /usr/local/X11R6 @@ -95,6 +106,8 @@ find_library(FREETYPE_LIBRARY ENV GTKMM_BASEPATH [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] + PATH_SUFFIXES + lib ) # set the user variables @@ -111,31 +124,41 @@ elseif(EXISTS "${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]+$") + file(STRINGS "${FREETYPE_H}" freetype_version_str + REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$") - unset(FREETYPE_VERSION_STRING) - foreach(VPART MAJOR MINOR PATCH) - foreach(VLINE ${freetype_version_str}) - if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$") - set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}") - if(FREETYPE_VERSION_STRING) - set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") - else() - set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") - endif() - unset(FREETYPE_VERSION_PART) - endif() - endforeach() + unset(FREETYPE_VERSION_STRING) + foreach(VPART MAJOR MINOR PATCH) + foreach(VLINE ${freetype_version_str}) + if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$") + set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}") + if(FREETYPE_VERSION_STRING) + set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") + else() + set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") + endif() + unset(FREETYPE_VERSION_PART) + endif() endforeach() + endforeach() endif() # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype - REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS - VERSION_VAR FREETYPE_VERSION_STRING) -mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build) +find_package_handle_standard_args( + Freetype + REQUIRED_VARS + FREETYPE_LIBRARY + FREETYPE_INCLUDE_DIRS + VERSION_VAR + FREETYPE_VERSION_STRING +) + +mark_as_advanced( + FREETYPE_LIBRARY + FREETYPE_INCLUDE_DIR_freetype2 + FREETYPE_INCLUDE_DIR_ft2build +) |