1
# - Try to find the Fontconfig
2
# Once done this will define
4
# FONTCONFIG_FOUND - system has Fontconfig
5
# FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers
6
# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG
7
# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG
9
# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
11
# Redistribution and use is allowed according to the terms of the BSD license.
12
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
15
if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
18
set(FONTCONFIG_FOUND TRUE)
20
else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
23
# use pkg-config to get the directories and then use these values
24
# in the FIND_PATH() and FIND_LIBRARY() calls
25
find_package(PkgConfig)
26
pkg_check_modules(PC_FONTCONFIG fontconfig)
28
set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER})
31
find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
33
${PC_FONTCONFIG_INCLUDEDIR}
34
${PC_FONTCONFIG_INCLUDE_DIRS}
38
find_library(FONTCONFIG_LIBRARIES NAMES fontconfig
40
${PC_FONTCONFIG_LIBDIR}
41
${PC_FONTCONFIG_LIBRARY_DIRS}
44
include(FindPackageHandleStandardArgs)
45
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
47
mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
49
endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)