CMake: Configure: Add Freetype support.

This commit is contained in:
kestred 2013-12-11 11:00:43 -07:00
parent 150624b27d
commit ee06025d43
3 changed files with 40 additions and 6 deletions

View File

@ -0,0 +1,32 @@
# Filename: MangleFREETYPE.cmake
# Author: kestred (11 Dec, 2013)
#
# MangleFREETYPE replaces the output variables of the builtin FindFREETYPE
# with vars matching Panda3D's existing config-var names.
#
if(FREETYPE_FOUND)
set(FOUND_FREETYPE TRUE)
list(GET FREETYPE_INCLUDE_DIRS 0 FREETYPE_INCLUDE_DIR)
get_filename_component(FREETYPE_LIBRARY_DIR "${FREETYPE_LIBRARY}" PATH)
set(FREETYPE_IPATH "${FREETYPE_INCLUDE_DIR}" CACHE PATH "The path to Freetype's include directory.") # Include path
set(FREETYPE_LPATH "${FREETYPE_LIBRARY_DIR}" CACHE PATH "The path to Freetype's library directory.") # Library path
mark_as_advanced(FREETYPE_IPATH)
mark_as_advanced(FREETYPE_LPATH)
set(FREETYPE_VERSION ${FREETYPE_VERSION_STRING})
unset(FREETYPE_FOUND)
unset(FREETYPE_LIBRARY)
unset(FREETYPE_INCLUDE_DIR)
unset(FREETYPE_LIBRARY_DIR)
endif()
unset(FREETYPE_LIBRARY CACHE)
unset(FREETYPE_LIBRARIES CACHE)
unset(FREETYPE_INCLUDE_DIRS CACHE)
unset(FREETYPE_INCLUDE_DIR_ft2build CACHE)
unset(FREETYPE_INCLUDE_DIR_freetype2 CACHE)

View File

@ -1,7 +1,7 @@
# Filename: MangleOpenAL.cmake
# Author: kestred (28 Nov, 2013)
# Filename: MangleGTK2.cmake
# Author: kestred (11 Dec, 2013)
#
# MangleOpenAL replaces the output variables of the builtin FindOpenAL
# MangleGTK2 replaces the output variables of the builtin FindGTK2
# with vars matching Panda3D's existing config-var names.
#
@ -19,6 +19,7 @@ if(GTK2_FOUND)
mark_as_advanced(GTK_LPATH)
unset(GTK2_FOUND)
unset(GTK2_LIBRARY)
unset(GTK2_INCLUDE_DIR)
unset(GTK2_LIBRARY_DIR)
unset(GTK2_MAJOR_VERSION)

View File

@ -116,6 +116,10 @@ find_package(GTK2 QUIET)
mangle_package(GTK2)
config_package(GTK COMMENT "gtk+-2")
# Find and configure Freetype
find_package(Freetype)
mangle_package(Freetype)
config_package(FREETYPE COMMENT "Freetype")
########
@ -130,9 +134,6 @@ config_package(GTK COMMENT "gtk+-2")
#find_package(SpeedTree)
#config_package(SPEEDTREE COMMENT "SpeedTree")
# Find and configure Freetype
#find_package(Freetype)
#config_package(FREETYPE COMMENT "Freetype")
# Find and configure WxWidgets
#find_package(WxWidgets)