FindFreetype.cmake 933 B

1234567891011121314151617181920212223242526
  1. # - Find Freetype
  2. # Find the Freetype includes and libraries
  3. #
  4. # Following variables are provided:
  5. # FREETYPE_FOUND
  6. # True if Freetype has been found
  7. # FREETYPE_INCLUDE_DIRS
  8. # The include directories of Freetype
  9. # FREETYPE_LIBRARIES
  10. # Freetype library list
  11. if(WIN32)
  12. find_path(FREETYPE_INCLUDE_DIRS NAMES freetype/freetype.h PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/include/freetype2")
  13. find_library(FREETYPE_LIBRARY NAMES freetype libfreetype PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
  14. set(FREETYPE_FOUND 1)
  15. set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
  16. elseif(APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
  17. find_path(FREETYPE_INCLUDE_DIRS NAMES ft2build.h PATH_SUFFIXES freetype2 include/freetype2 include)
  18. find_library(FREETYPE_LIBRARY NAMES freetype)
  19. set(FREETYPE_FOUND 1)
  20. set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
  21. else()
  22. pkg_check_modules(FREETYPE freetype2)
  23. endif()