diff options
author | Stuart Mentzer <Stuart_Mentzer@objexx.com> | 2016-06-08 04:26:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-09 12:55:24 (GMT) |
commit | 746a4245738c7b3c0b29754cb09b2230697f13fc (patch) | |
tree | 106efada07914d5ac3a1b8d800e0a685c5a6b203 /Modules | |
parent | 39699947589e96b59d7f56d9c0b1dcb1bef27f8a (diff) | |
download | CMake-746a4245738c7b3c0b29754cb09b2230697f13fc.zip CMake-746a4245738c7b3c0b29754cb09b2230697f13fc.tar.gz CMake-746a4245738c7b3c0b29754cb09b2230697f13fc.tar.bz2 |
FindFreetype: Factor out common find command arguments
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindFreetype.cmake | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 7d46d15..dc6336d 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -51,9 +51,8 @@ # 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 + +set(FREETYPE_FIND_ARGS HINTS ENV FREETYPE_DIR PATHS @@ -64,6 +63,12 @@ find_path( ENV GTKMM_BASEPATH [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] +) + +find_path( + FREETYPE_INCLUDE_DIR_ft2build + ft2build.h + ${FREETYPE_FIND_ARGS} PATH_SUFFIXES include/freetype2 include @@ -75,16 +80,7 @@ find_path( NAMES freetype/config/ftheader.h config/ftheader.h - HINTS - ENV FREETYPE_DIR - PATHS - /usr/X11R6 - /usr/local/X11R6 - /usr/local/X11 - /usr/freeware - ENV GTKMM_BASEPATH - [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] + ${FREETYPE_FIND_ARGS} PATH_SUFFIXES include/freetype2 include @@ -96,20 +92,13 @@ find_library(FREETYPE_LIBRARY freetype libfreetype freetype219 - HINTS - ENV FREETYPE_DIR - PATHS - /usr/X11R6 - /usr/local/X11R6 - /usr/local/X11 - /usr/freeware - ENV GTKMM_BASEPATH - [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] + ${FREETYPE_FIND_ARGS} PATH_SUFFIXES lib ) +unset(FREETYPE_FIND_ARGS) + # 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}") |