2010-05-06 00:08:41 +00:00
|
|
|
# - Locate FreeType library
|
|
|
|
# This module defines
|
2013-09-08 08:26:23 +00:00
|
|
|
# FREETYPE_LIBRARIES, libraries to link against
|
2010-05-06 00:08:41 +00:00
|
|
|
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
|
|
|
|
# FREETYPE_INCLUDE_DIRS, where to find headers.
|
|
|
|
|
2013-09-08 08:26:23 +00:00
|
|
|
IF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
|
2010-05-06 00:08:41 +00:00
|
|
|
# in cache already
|
2013-09-08 08:26:23 +00:00
|
|
|
SET(Freetype_FIND_QUIETLY TRUE)
|
|
|
|
ENDIF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
|
2010-05-06 00:08:41 +00:00
|
|
|
|
2014-01-26 10:03:33 +00:00
|
|
|
FIND_PATH(FREETYPE_INCLUDE_DIR
|
2010-06-28 19:05:16 +00:00
|
|
|
ft2build.h
|
|
|
|
PATHS
|
|
|
|
/usr/local/include
|
|
|
|
/usr/include
|
|
|
|
/sw/include
|
|
|
|
/opt/local/include
|
|
|
|
/opt/csw/include
|
|
|
|
/opt/include
|
2014-01-22 09:24:35 +00:00
|
|
|
PATH_SUFFIXES freetype2
|
2010-06-28 19:05:16 +00:00
|
|
|
)
|
|
|
|
|
2014-01-26 10:03:33 +00:00
|
|
|
IF(FREETYPE_INCLUDE_DIR)
|
|
|
|
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
|
|
|
|
ENDIF(FREETYPE_INCLUDE_DIR)
|
2010-06-28 19:05:16 +00:00
|
|
|
|
2013-09-08 08:26:23 +00:00
|
|
|
FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE
|
2011-08-13 21:36:37 +00:00
|
|
|
NAMES freetype libfreetype freetype219 freetype246
|
2010-05-06 00:08:41 +00:00
|
|
|
PATHS
|
|
|
|
$ENV{FREETYPE_DIR}/lib
|
|
|
|
/usr/local/lib
|
|
|
|
/usr/lib
|
|
|
|
/usr/local/X11R6/lib
|
|
|
|
/usr/X11R6/lib
|
|
|
|
/sw/lib
|
|
|
|
/opt/local/lib
|
|
|
|
/opt/csw/lib
|
|
|
|
/opt/lib
|
|
|
|
/usr/freeware/lib64
|
2013-09-13 22:36:06 +00:00
|
|
|
/usr/lib/x86_64-linux-gnu
|
2010-05-06 00:08:41 +00:00
|
|
|
)
|
|
|
|
|
2013-09-08 08:26:23 +00:00
|
|
|
FIND_LIBRARY(FREETYPE_LIBRARY_DEBUG
|
|
|
|
NAMES freetyped libfreetyped freetype219d freetype246d
|
|
|
|
PATHS
|
|
|
|
$ENV{FREETYPE_DIR}/lib
|
|
|
|
/usr/local/lib
|
|
|
|
/usr/lib
|
|
|
|
/usr/local/X11R6/lib
|
|
|
|
/usr/X11R6/lib
|
|
|
|
/sw/lib
|
|
|
|
/opt/local/lib
|
|
|
|
/opt/csw/lib
|
|
|
|
/opt/lib
|
|
|
|
/usr/freeware/lib64
|
2013-09-13 22:36:06 +00:00
|
|
|
/usr/lib/x86_64-linux-gnu
|
2013-09-08 08:26:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
IF(FREETYPE_INCLUDE_DIRS)
|
|
|
|
IF(FREETYPE_LIBRARY_RELEASE AND FREETYPE_LIBRARY_DEBUG)
|
|
|
|
# Case where both Release and Debug versions are provided
|
|
|
|
SET(FREETYPE_FOUND ON)
|
|
|
|
SET(FREETYPE_LIBRARIES optimized ${FREETYPE_LIBRARY_RELEASE} debug ${FREETYPE_LIBRARY_DEBUG})
|
|
|
|
ELSEIF(FREETYPE_LIBRARY_RELEASE)
|
|
|
|
# Normal case
|
|
|
|
SET(FREETYPE_FOUND ON)
|
|
|
|
SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY_RELEASE})
|
|
|
|
ELSEIF(FREETYPE_LIBRARY_DEBUG)
|
|
|
|
# Case where Freetype is compiled from sources (debug version is compiled by default)
|
|
|
|
SET(FREETYPE_FOUND ON)
|
|
|
|
SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY_DEBUG})
|
|
|
|
ENDIF(FREETYPE_LIBRARY_RELEASE AND FREETYPE_LIBRARY_DEBUG)
|
|
|
|
ENDIF(FREETYPE_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
IF(FREETYPE_FOUND)
|
2012-03-09 13:39:37 +00:00
|
|
|
IF(WITH_STATIC_EXTERNAL AND APPLE)
|
|
|
|
FIND_PACKAGE(BZip2)
|
|
|
|
IF(BZIP2_FOUND)
|
|
|
|
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR})
|
2013-09-08 08:26:23 +00:00
|
|
|
SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} ${BZIP2_LIBRARIES})
|
2012-03-09 13:39:37 +00:00
|
|
|
ENDIF(BZIP2_FOUND)
|
|
|
|
ENDIF(WITH_STATIC_EXTERNAL AND APPLE)
|
2013-09-08 08:26:23 +00:00
|
|
|
IF(NOT Freetype_FIND_QUIETLY)
|
|
|
|
MESSAGE(STATUS "Found FreeType: ${FREETYPE_LIBRARIES}")
|
|
|
|
ENDIF(NOT Freetype_FIND_QUIETLY)
|
2010-05-06 00:08:41 +00:00
|
|
|
ELSE(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
|
2013-09-08 08:26:23 +00:00
|
|
|
IF(NOT Freetype_FIND_QUIETLY)
|
2010-05-06 00:08:41 +00:00
|
|
|
MESSAGE(STATUS "Warning: Unable to find FreeType!")
|
2013-09-08 08:26:23 +00:00
|
|
|
ENDIF(NOT Freetype_FIND_QUIETLY)
|
|
|
|
ENDIF(FREETYPE_FOUND)
|