Skip to content

Instantly share code, notes, and snippets.

@sgolemon
Created January 10, 2014 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgolemon/8362044 to your computer and use it in GitHub Desktop.
Save sgolemon/8362044 to your computer and use it in GitHub Desktop.
Possible fix for freetype linking
diff --git a/CMake/FindFreetype.cmake b/CMake/FindFreetype.cmake
index 4603d01..3a3d4bf 100644
--- a/CMake/FindFreetype.cmake
+++ b/CMake/FindFreetype.cmake
@@ -1,15 +1,10 @@
-if (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
- set (Freetype_FIND_QUIETLY TRUE)
-endif (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
+find_package(PkgConfig)
+pkg_check_modules(PC_FREETYPE QUIET freetype2)
-find_path(FREETYPE_INCLUDE_DIRS NAMES freetype/freetype.h)
-if (NOT FREETYPE_INCLUDE_DIRS)
- find_path(FREETYPE_INCLUDE_DIRS NAMES freetype2/freetype/freetype.h)
- if (FREETYPE_INCLUDE_DIRS)
- set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIRS}/freetype2" CACHE PATH "Freetype include directory" FORCE)
- endif()
-endif()
+find_path(FREETYPE_INCLUDE_DIRS NAMES freetype/config/ftheader.h
+ HINTS ${PC_FREETYPE_INCLUDEDIR} ${PC_FREETYPE_INCLUDE_DIRS}
+ PATH_SUFFIXES freetype2)
find_library(FREETYPE_LIBRARIES NAMES freetype)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment