1
# - Try to find Fontconfig
2
# Once done this will define
4
# FONTCONFIG_FOUND - system has Fontconfig
5
# FONTCONFIG_INCLUDE_DIR - the Fontconfig include directory
6
# FONTCONFIG_LIBRARIES - Link these to use Fontconfig
7
# Redistribution and use is allowed according to the terms of the BSD license.
8
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
12
if ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARIES )
14
SET(Fontconfig_FIND_QUIETLY TRUE)
15
endif ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARIES )
17
# use pkg-config to get the directories and then use these values
18
# in the FIND_PATH() and FIND_LIBRARY() calls
20
find_package(PkgConfig)
22
pkg_check_modules(FONTCONFIG_PKG QUIET fontconfig)
25
FIND_PATH(FONTCONFIG_INCLUDE_DIR NAMES fontconfig/fontconfig.h
31
${FONTCONFIG_PKG_INCLUDE_DIRS} # Generated by pkg-config
34
FIND_LIBRARY(FONTCONFIG_LIBRARIES NAMES fontconfig ${FONTCONFIG_PKG_LIBRARIES}
40
${FONTCONFIG_PKG_LIBRARY_DIRS} # Generated by pkg-config
46
include(FindPackageHandleStandardArgs)
47
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
49
# show the FONTCONFIG_INCLUDE_DIR and FONTCONFIG_LIBRARIES variables only in the advanced view
50
MARK_AS_ADVANCED(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIBRARIES )