<commit_before>#sourced from
#https://github.com/rougier/freetype-gl/blob/master/CMakeModules/FindFontConfig.cmake

# - Try to find Fontconfig
# Once done this will define
#
#  FONTCONFIG_FOUND - system has Fontconfig
#  FONTCONFIG_INCLUDE_DIR - the Fontconfig include directory
#  FONTCONFIG_LIBRARY - Link these to use Fontconfig
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARY )
    # in cache already
    SET(Fontconfig_FIND_QUIETLY TRUE)
endif ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARY )

# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if(NOT WIN32)
    find_package(PkgConfig)

    pkg_check_modules(FONTCONFIG_PKG QUIET fontconfig)
endif(NOT WIN32)

FIND_PATH(FONTCONFIG_INCLUDE_DIR NAMES fontconfig/fontconfig.h
    PATHS
    /usr/local/include
    /usr/X11/include
    /usr/include
    HINTS
    ${FONTCONFIG_PKG_INCLUDE_DIRS} # Generated by pkg-config
    )

FIND_LIBRARY(FONTCONFIG_LIBRARY NAMES fontconfig ${FONTCONFIG_PKG_LIBRARY}
    PATHS
    /usr/local
    /usr/X11
    /usr
    HINTS
    ${FONTCONFIG_PKG_LIBRARY_DIRS} # Generated by pkg-config
    PATH_SUFFIXES
    lib64
    lib
    )

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR)

# show the FONTCONFIG_INCLUDE_DIR and FONTCONFIG_LIBRARY variables only in the advanced view
MARK_AS_ADVANCED(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIBRARY)
<commit_msg>Checks to report fatal error if FontConfig is not available<commit_after>#sourced from
#https://github.com/rougier/freetype-gl/blob/master/CMakeModules/FindFontConfig.cmake

# - Try to find Fontconfig
# Once done this will define
#
#  FONTCONFIG_FOUND - system has Fontconfig
#  FONTCONFIG_INCLUDE_DIR - the Fontconfig include directory
#  FONTCONFIG_LIBRARY - Link these to use Fontconfig
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

IF ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARY )
    # in cache already
    SET(Fontconfig_FIND_QUIETLY TRUE)
ENDIF ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARY )

# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
IF (NOT WIN32)
    FIND_PACKAGE(PkgConfig)

    pkg_check_modules(FONTCONFIG_PKG QUIET fontconfig)
ENDIF (NOT WIN32)

FIND_PATH(FONTCONFIG_INCLUDE_DIR NAMES fontconfig/fontconfig.h
    PATHS
    /usr/local/include
    /usr/X11/include
    /usr/include
    HINTS
    ${FONTCONFIG_PKG_INCLUDE_DIRS} # Generated by pkg-config
    )

IF (DEFINED FONTCONFIG_INCLUDE_DIR-NOTFOUND)
    MESSAGE(FATAL_ERROR "FontConfig header files not found")
ENDIF (DEFINED FONTCONFIG_INCLUDE_DIR-NOTFOUND)

FIND_LIBRARY(FONTCONFIG_LIBRARY NAMES fontconfig ${FONTCONFIG_PKG_LIBRARY}
    PATHS
    /usr/local
    /usr/X11
    /usr
    HINTS
    ${FONTCONFIG_PKG_LIBRARY_DIRS} # Generated by pkg-config
    PATH_SUFFIXES
    lib64
    lib
    )

IF (DEFINED FONTCONFIG_LIBRARY-NOTFOUND)
    MESSAGE(FATAL_ERROR "FontConfig library files not found")
ENDIF (DEFINED FONTCONFIG_LIBRARY-NOTFOUND)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR)

# show the FONTCONFIG_INCLUDE_DIR and FONTCONFIG_LIBRARY variables only in the advanced view
MARK_AS_ADVANCED(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIBRARY)

{'fraction_non_alphanumeric': 0.05769764216366158, 'fraction_numerical': 0.005547850208044383, 'mean_word_length': 4.778846153846154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7298874', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1195, 'n_words': 297}