FindFreetype.cmake 1.1 KB

123456789101112131415161718192021222324252627282930
  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")
  13. find_library(FREETYPE_LIBRARY NAMES freetype PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
  14. set(FREETYPE_FOUND 1)
  15. set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
  16. elseif(APPLE)
  17. find_path(FREETYPE_INCLUDE_DIRS NAMES freetype/freetype.h PATHS "/Library/Frameworks/FreeType.Framework/Versions/2.4/unix/include")
  18. find_library(FREETYPE_LIBRARY NAMES freetype PATHS "/Library/Frameworks/FreeType.Framework/Versions/2.4/")
  19. include_directories(/Library/Frameworks/FreeType.Framework/Versions/2.4/unix/include)
  20. set(FREETYPE_FOUND 1)
  21. set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
  22. elseif(UNIX)
  23. include(FindPkgConfig)
  24. pkg_check_modules(FREETYPE freetype2)
  25. else()
  26. set(FREETYPE_FOUND 0)
  27. endif()