Skip to content

Commit d2fc98e

Browse files
AMDmi3kwolekr
authored andcommittedApr 8, 2015
Fix freetype detection
Don't reinvent freetype detection, use working one from cmake.
1 parent 0df7361 commit d2fc98e

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed
 

Diff for: ‎src/CMakeLists.txt

+23-16
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,30 @@ option(ENABLE_FREETYPE "Enable FreeType2 (TrueType fonts and basic unicode suppo
111111
set(USE_FREETYPE FALSE)
112112

113113
if(ENABLE_FREETYPE)
114-
if(UNIX)
115-
include(FindPkgConfig)
116-
if(PKG_CONFIG_FOUND)
117-
pkg_check_modules(FREETYPE QUIET freetype2)
118-
if(FREETYPE_FOUND)
119-
SET(FREETYPE_PKGCONFIG_FOUND TRUE)
120-
SET(FREETYPE_LIBRARY ${FREETYPE_LIBRARIES})
121-
# Because CMake is idiotic
122-
string(REPLACE ";" " " FREETYPE_CFLAGS_STR ${FREETYPE_CFLAGS})
123-
string(REPLACE ";" " " FREETYPE_LDFLAGS_STR ${FREETYPE_LDFLAGS})
124-
endif(FREETYPE_FOUND)
125-
endif(PKG_CONFIG_FOUND)
126-
endif(UNIX)
127-
if(NOT FREETYPE_FOUND)
128-
find_package(Freetype)
129-
endif()
114+
##
115+
## Note: FindFreetype.cmake seems to have been fixed in recent versions of
116+
## CMake. If issues persist, re-enable this workaround specificially for the
117+
## failing platforms.
118+
##
119+
# if(UNIX)
120+
# include(FindPkgConfig)
121+
# if(PKG_CONFIG_FOUND)
122+
# pkg_check_modules(FREETYPE QUIET freetype2)
123+
# if(FREETYPE_FOUND)
124+
# SET(FREETYPE_PKGCONFIG_FOUND TRUE)
125+
# SET(FREETYPE_LIBRARY ${FREETYPE_LIBRARIES})
126+
# # Because CMake is idiotic
127+
# string(REPLACE ";" " " FREETYPE_CFLAGS_STR ${FREETYPE_CFLAGS})
128+
# string(REPLACE ";" " " FREETYPE_LDFLAGS_STR ${FREETYPE_LDFLAGS})
129+
# endif(FREETYPE_FOUND)
130+
# endif(PKG_CONFIG_FOUND)
131+
# endif(UNIX)
132+
# if(NOT FREETYPE_FOUND)
133+
# find_package(Freetype)
134+
# endif()
135+
find_package(Freetype)
130136
if(FREETYPE_FOUND)
137+
message(STATUS "Freetype enabled.")
131138
set(USE_FREETYPE TRUE)
132139
set(CGUITTFONT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cguittfont")
133140
set(CGUITTFONT_LIBRARY cguittfont)

0 commit comments

Comments
 (0)
Please sign in to comment.