2021-03-07 02:40:21 +02:00
|
|
|
# Try to find Fontconfig, once done this will define:
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
|
|
|
# FONTCONFIG_FOUND - system has Fontconfig
|
2020-02-25 17:23:40 +00:00
|
|
|
# FONTCONFIG_INCLUDE_DIR -the Fontconfig include directory
|
|
|
|
# FONTCONFIG_LIBRARIES - the libraries needed to use Fontconfig
|
|
|
|
# FONTCONFIG_DEFINITIONS - compiler switches required for using Fontconfig
|
|
|
|
#
|
2021-03-07 02:40:21 +02:00
|
|
|
# Copyright (c) 2020 Ivailo Monev <xakepa10@gmail.com>
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(PC_FONTCONFIG QUIET fontconfig)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
set(FONTCONFIG_INCLUDE_DIR ${PC_FONTCONFIG_INCLUDE_DIRS})
|
|
|
|
set(FONTCONFIG_LIBRARIES ${PC_FONTCONFIG_LIBRARIES})
|
2020-02-25 17:23:40 +00:00
|
|
|
set(FONTCONFIG_VERSION ${PC_FONTCONFIG_VERSION})
|
|
|
|
set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER})
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-25 17:23:40 +00:00
|
|
|
if(NOT FONTCONFIG_INCLUDE_DIR OR NOT FONTCONFIG_LIBRARIES)
|
|
|
|
find_path(FONTCONFIG_INCLUDE_DIR
|
|
|
|
NAMES fontconfig/fontconfig.h
|
|
|
|
HINTS $ENV{FONTCONFIGDIR}/include
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-25 17:23:40 +00:00
|
|
|
find_library(FONTCONFIG_LIBRARIES
|
|
|
|
NAMES fontconfig
|
|
|
|
HINTS $ENV{FONTCONFIGDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-25 17:23:40 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Fontconfig
|
|
|
|
VERSION_VAR FONTCONFIG_VERSION
|
|
|
|
REQUIRED_VARS FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-25 17:23:40 +00:00
|
|
|
mark_as_advanced(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIBRARIES)
|