2015-10-04 11:59:44 +08:00
|
|
|
# - Find Freetype
|
|
|
|
# Find the Freetype includes and libraries
|
|
|
|
#
|
|
|
|
# Following variables are provided:
|
|
|
|
# FREETYPE_FOUND
|
|
|
|
# True if Freetype has been found
|
|
|
|
# FREETYPE_INCLUDE_DIRS
|
|
|
|
# The include directories of Freetype
|
|
|
|
# FREETYPE_LIBRARIES
|
|
|
|
# Freetype library list
|
|
|
|
|
2015-10-19 19:59:33 +02:00
|
|
|
if(WIN32)
|
2021-04-27 16:19:17 +08:00
|
|
|
find_path(FREETYPE_INCLUDE_DIRS NAMES freetype/freetype.h PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/include/freetype2")
|
2019-06-09 10:06:50 +08:00
|
|
|
find_library(FREETYPE_LIBRARY NAMES freetype libfreetype PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
|
2015-10-04 11:59:44 +08:00
|
|
|
set(FREETYPE_FOUND 1)
|
2015-10-31 00:29:53 +08:00
|
|
|
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
|
2015-10-18 19:44:28 -04:00
|
|
|
elseif(APPLE)
|
2020-07-28 13:10:15 +08:00
|
|
|
find_path(FREETYPE_INCLUDE_DIRS NAMES ft2build.h PATH_SUFFIXES freetype2 include/freetype2 include PATHS "/Library/Frameworks/FreeType.Framework/Versions/2.4/unix/include")
|
2015-10-31 00:29:53 +08:00
|
|
|
find_library(FREETYPE_LIBRARY NAMES freetype PATHS "/Library/Frameworks/FreeType.Framework/Versions/2.4/")
|
2015-10-18 19:44:28 -04:00
|
|
|
include_directories(/Library/Frameworks/FreeType.Framework/Versions/2.4/unix/include)
|
|
|
|
set(FREETYPE_FOUND 1)
|
2015-10-31 00:29:53 +08:00
|
|
|
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
|
2015-10-04 11:59:44 +08:00
|
|
|
elseif(UNIX)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(FREETYPE freetype2)
|
|
|
|
else()
|
|
|
|
set(FREETYPE_FOUND 0)
|
|
|
|
endif()
|
|
|
|
|