Home | History | Annotate | Download | only in cmake
      1 # - Try to find Freetype2
      2 # Once done, this will define
      3 #
      4 #  Freetype_FOUND - system has Freetype
      5 #  Freetype_INCLUDE_DIRS - the Freetype include directories
      6 #  Freetype_LIBRARIES - link these to use Freetype
      7 
      8 include(LibFindMacros)
      9 
     10 # Use pkg-config to get hints about paths
     11 libfind_pkg_check_modules(Freetype_PKGCONF freetype2)
     12 
     13 # Include dir
     14 find_path(Freetype_INCLUDE_DIR
     15   NAMES freetype/freetype.h
     16   PATHS ${Freetype_PKGCONF_INCLUDE_DIRS}
     17   PATH_SUFFIXES freetype2
     18 )
     19 
     20 # Finally the library itself
     21 find_library(Freetype_LIBRARY
     22   NAMES freetype
     23   PATHS ${Freetype_PKGCONF_LIBRARY_DIRS}
     24 )
     25 
     26 # Set the include dir variables and the libraries and let libfind_process do the rest.
     27 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
     28 set(Freetype_PROCESS_INCLUDES Freetype_INCLUDE_DIR)
     29 set(Freetype_PROCESS_LIBS Freetype_LIBRARY)
     30 libfind_process(Freetype)
     31 
     32