Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix freetype library link error for 7.2 text rendering #230

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ elseif(APPLE)
FIND_LIBRARY(IOKit_LIBRARY IOKit)
FIND_LIBRARY(CoreVideo_LIBRARY CoreVideo)
MARK_AS_ADVANCED(COCOA_LIBRARY OpenGL_LIBRARY)
find_package(FreeType2 REQUIRED)
message(STATUS "Found FreeType2 in ${FREETYPE2_INCLUDE_DIR}")
SET(APPLE_LIBS ${COCOA_LIBRARY} ${IOKit_LIBRARY} ${OpenGL_LIBRARY} ${CoreVideo_LIBRARY})
SET(APPLE_LIBS ${APPLE_LIBS} ${GLFW3_LIBRARY} ${ASSIMP_LIBRARY})
SET(APPLE_LIBS ${APPLE_LIBS} ${GLFW3_LIBRARY} ${ASSIMP_LIBRARY} ${FREETYPE2_LIBRARY})
set(LIBS ${LIBS} ${APPLE_LIBS})
else()
set(LIBS )
Expand Down
34 changes: 34 additions & 0 deletions cmake/modules/FindFreeType2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# - Try to find FreeType2
# Once done, this will define
#
# FreeType2_FOUND - system has FreeType2
# FreeType2_INCLUDE_DIR - the FreeType2 include directories
# FreeType2_LIBRARIES - link these to use FreeType2
FIND_PATH( FREETYPE2_INCLUDE_DIR freetype2/ft2build.h
/usr/include
/usr/local/include
/opt/local/include
/usr/local/opt/freetype/include
${CMAKE_SOURCE_DIR}/includes
)
FIND_LIBRARY( FREETYPE2_LIBRARY freetype
/usr/lib64
/usr/lib
/usr/local/lib
/opt/local/lib
/usr/local/opt/freetype/lib
${CMAKE_SOURCE_DIR}/lib
)
IF(FREETYPE2_INCLUDE_DIR AND FREETYPE2_LIBRARY)
SET( FREETYPE2_FOUND TRUE )
SET( FREETYPE2_LIBRARIES ${FREETYPE2_LIBRARY} )
ENDIF(FREETYPE2_INCLUDE_DIR AND FREETYPE2_LIBRARY)
IF(FREETYPE2_FOUND)
IF(NOT FREETYPE2_FIND_QUIETLY)
MESSAGE(STATUS "Found FREETYPE2: ${FREETYPE2_LIBRARY}")
ENDIF(NOT FREETYPE2_FIND_QUIETLY)
ELSE(FREETYPE2_FOUND)
IF(FREETYPE2_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find libfreetype")
ENDIF(FREETYPE2_FIND_REQUIRED)
ENDIF(FREETYPE2_FOUND)