FindFreetype: Factor out common find command arguments

This commit is contained in:
Stuart Mentzer 2016-06-08 00:26:31 -04:00 committed by Brad King
parent 3969994758
commit 746a424573
1 changed files with 12 additions and 23 deletions

View File

@ -51,9 +51,8 @@
# wants explicit full paths and this trickery doesn't work too well. # wants explicit full paths and this trickery doesn't work too well.
# I'm going to attempt to cut out the middleman and hope # I'm going to attempt to cut out the middleman and hope
# everything still works. # everything still works.
find_path(
FREETYPE_INCLUDE_DIR_ft2build set(FREETYPE_FIND_ARGS
ft2build.h
HINTS HINTS
ENV FREETYPE_DIR ENV FREETYPE_DIR
PATHS PATHS
@ -64,6 +63,12 @@ find_path(
ENV GTKMM_BASEPATH ENV GTKMM_BASEPATH
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\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 PATH_SUFFIXES
include/freetype2 include/freetype2
include include
@ -75,16 +80,7 @@ find_path(
NAMES NAMES
freetype/config/ftheader.h freetype/config/ftheader.h
config/ftheader.h config/ftheader.h
HINTS ${FREETYPE_FIND_ARGS}
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]
PATH_SUFFIXES PATH_SUFFIXES
include/freetype2 include/freetype2
include include
@ -96,20 +92,13 @@ find_library(FREETYPE_LIBRARY
freetype freetype
libfreetype libfreetype
freetype219 freetype219
HINTS ${FREETYPE_FIND_ARGS}
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]
PATH_SUFFIXES PATH_SUFFIXES
lib lib
) )
unset(FREETYPE_FIND_ARGS)
# set the user variables # set the user variables
if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")