2014-08-17 05:20:38 -07:00
|
|
|
# Once done these will be defined:
|
|
|
|
#
|
2014-08-20 17:20:05 -07:00
|
|
|
# FREETYPE_FOUND
|
|
|
|
# FREETYPE_INCLUDE_DIRS
|
|
|
|
# FREETYPE_LIBRARIES
|
2014-08-17 05:20:38 -07:00
|
|
|
|
2014-09-15 14:30:40 -07:00
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(_FREETYPE QUIET freetype2)
|
|
|
|
endif()
|
2014-08-17 05:20:38 -07:00
|
|
|
|
2014-09-15 14:30:40 -07:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(_lib_suffix 64)
|
|
|
|
else()
|
|
|
|
set(_lib_suffix 32)
|
|
|
|
endif()
|
2014-08-17 05:20:38 -07:00
|
|
|
|
2014-09-15 14:30:40 -07:00
|
|
|
find_path(FREETYPE_INCLUDE_DIR_ft2build
|
|
|
|
NAMES
|
|
|
|
ft2build.h
|
|
|
|
HINTS
|
|
|
|
ENV FreetypePath${_lib_suffix}
|
|
|
|
ENV FreetypePath
|
|
|
|
ENV FREETYPE_DIR
|
2015-06-30 10:05:20 -07:00
|
|
|
ENV DepsPath${_lib_suffix}
|
|
|
|
ENV DepsPath
|
2015-07-13 14:36:20 -07:00
|
|
|
${FreetypePath${_lib_suffix}}
|
2015-06-30 10:05:20 -07:00
|
|
|
${FreetypePath}
|
2015-07-13 14:36:20 -07:00
|
|
|
${DepsPath${_lib_suffix}}
|
2015-06-30 10:05:20 -07:00
|
|
|
${DepsPath}
|
2014-09-23 06:21:27 -07:00
|
|
|
${_FREETYPE_INCLUDE_DIRS}
|
2014-09-15 14:30:40 -07:00
|
|
|
PATHS
|
|
|
|
/usr/include /usr/local/include /opt/local/include /sw/include
|
|
|
|
PATH_SUFFIXES
|
|
|
|
freetype2 include/freetype2 include)
|
2014-08-17 05:20:38 -07:00
|
|
|
|
2014-09-15 14:30:40 -07:00
|
|
|
find_path(FREETYPE_INCLUDE_DIR_freetype2
|
|
|
|
NAMES
|
|
|
|
freetype/config/ftheader.h
|
|
|
|
config/ftheader.h
|
|
|
|
HINTS
|
|
|
|
ENV FreetypePath${_lib_suffix}
|
|
|
|
ENV FreetypePath
|
|
|
|
ENV FREETYPE_DIR
|
2015-07-13 14:36:20 -07:00
|
|
|
ENV DepsPath${_lib_suffix}
|
|
|
|
ENV DepsPath
|
|
|
|
${FreetypePath${_lib_suffix}}
|
|
|
|
${FreetypePath}
|
|
|
|
${DepsPath${_lib_suffix}}
|
|
|
|
${DepsPath}
|
2014-09-23 06:21:27 -07:00
|
|
|
${_FREETYPE_INCLUDE_DIRS}
|
2014-09-15 14:30:40 -07:00
|
|
|
PATHS
|
|
|
|
/usr/include /usr/local/include /opt/local/include /sw/include
|
|
|
|
PATH_SUFFIXES
|
|
|
|
freetype2 include/freetype2 include)
|
2014-08-17 05:20:38 -07:00
|
|
|
|
2014-09-15 14:30:40 -07:00
|
|
|
find_library(FREETYPE_LIB
|
|
|
|
NAMES ${_FREETYPE_LIBRARIES} freetype libfreetype
|
|
|
|
HINTS
|
2014-09-23 06:21:27 -07:00
|
|
|
ENV FreetypePath${_lib_suffix}
|
|
|
|
ENV FreetypePath
|
2014-09-15 14:30:40 -07:00
|
|
|
ENV FREETYPE_DIR
|
2015-07-13 14:36:20 -07:00
|
|
|
ENV DepsPath${_lib_suffix}
|
|
|
|
ENV DepsPath
|
|
|
|
${FreetypePath${_lib_suffix}}
|
|
|
|
${FreetypePath}
|
|
|
|
${DepsPath${_lib_suffix}}
|
|
|
|
${DepsPath}
|
2014-09-23 06:21:27 -07:00
|
|
|
${_FREETYPE_LIBRARY_DIRS}
|
2014-09-15 14:30:40 -07:00
|
|
|
PATHS
|
|
|
|
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
|
|
|
PATH_SUFFIXES
|
2014-09-23 06:21:27 -07:00
|
|
|
lib${_lib_suffix} lib
|
|
|
|
libs${_lib_suffix} libs
|
|
|
|
bin${_lib_suffix} bin
|
|
|
|
../lib${_lib_suffix} ../lib
|
|
|
|
../libs${_lib_suffix} ../libs
|
|
|
|
../bin${_lib_suffix} ../bin)
|
2014-08-20 17:20:05 -07:00
|
|
|
|
2014-09-15 14:30:40 -07:00
|
|
|
if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
|
|
|
|
set(FREETYPE_INCLUDE_DIR "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
|
|
|
|
list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIR)
|
|
|
|
else()
|
|
|
|
unset(FREETYPE_INCLUDE_DIR)
|
|
|
|
endif()
|
2014-08-17 05:20:38 -07:00
|
|
|
|
2014-09-15 14:30:40 -07:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Freetype DEFAULT_MSG FREETYPE_LIB FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
|
|
|
|
mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_LIB)
|
2014-08-17 05:20:38 -07:00
|
|
|
|
2014-09-15 14:30:40 -07:00
|
|
|
if(FREETYPE_FOUND)
|
|
|
|
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
|
|
|
|
set(FREETYPE_LIBRARIES ${FREETYPE_LIB})
|
2014-08-17 05:20:38 -07:00
|
|
|
endif()
|