1 # - Find FontConfig library 2 # Find the FontConfig includes and library 4 # FONTCONFIG_INCLUDE_DIR, where to find fontconfig.h 5 # FONTCONFIG_LIBRARIES, libraries to link against to use the FontConfig API. 6 # FONTCONFIG_FOUND, If false, do not try to use FontConfig. 8 #============================================================================= 9 # Copyright 2012 Kitware, Inc. 11 # Distributed under the OSI-approved BSD License (the "License"); 12 # see accompanying file Copyright.txt for details. 14 # This software is distributed WITHOUT ANY WARRANTY; without even the 15 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 # See the License for more information. 17 #============================================================================= 18 # (To distribute this file outside of VTK, substitute the full 19 # License text for the above reference.) 21 find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h)
23 find_library(FONTCONFIG_LIBRARY NAMES fontconfig)
25 # handle the QUIETLY and REQUIRED arguments and set FONTCONFIG_FOUND to TRUE if 26 # all listed variables are TRUE 27 include(FindPackageHandleStandardArgs)
28 find_package_handle_standard_args(FontConfig DEFAULT_MSG
29 FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR)
32 if (NOT TARGET FontConfig::FontConfig)
33 add_library(FontConfig::FontConfig UNKNOWN IMPORTED)
34 set_target_properties(FontConfig::FontConfig PROPERTIES
35 IMPORTED_LOCATION
"${FONTCONFIG_LIBRARY}" 36 INTERFACE_INCLUDE_DIRECTORIES
"${FONTCONFIG_INCLUDE_DIR}")
38 set( FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY} )
41 mark_as_advanced(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIBRARY FONTCONFIG_LIBRARIES)