Trying ttf loading
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
#
|
||||
# Find FREETYPE
|
||||
#
|
||||
# Try to find FREETYPE library.
|
||||
# This module defines the following variables:
|
||||
# - FREETYPE_INCLUDE_DIRS
|
||||
# - FREETYPE_LIBRARIES
|
||||
# - FREETYPE_FOUND
|
||||
#
|
||||
# The following variables can be set as arguments for the module.
|
||||
# - FREETYPE_ROOT : Root library directory of FREETYPE
|
||||
# - FREETYPE_USE_STATIC_LIBS : Specifies to use static version of FREETYPE library (Windows only)
|
||||
#
|
||||
# References:
|
||||
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindFREETYPE.cmake
|
||||
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindFREETYPE.cmake
|
||||
#
|
||||
|
||||
# Additional modules
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if (WIN32)
|
||||
# Find include files
|
||||
find_path(
|
||||
FREETYPE_INCLUDE_DIR
|
||||
NAMES freetype/freetype.h
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/include
|
||||
${FREETYPE_ROOT}/include
|
||||
DOC "The directory where FREETYPE/glfw.h resides")
|
||||
|
||||
# Find library files
|
||||
find_library(
|
||||
FREETYPE_LIBRARY
|
||||
NAMES freetype${CMAKE_DEBUG_POSTFIX}.lib
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/lib
|
||||
${FREETYPE_ROOT}/lib
|
||||
${FREETYPE_ROOT}
|
||||
PATH_SUFFIXES Debug Release)
|
||||
|
||||
|
||||
find_file(
|
||||
FREETYPE_BINARY
|
||||
NAMES freetype${CMAKE_DEBUG_POSTFIX}.dll
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/bin
|
||||
${CMAKE_BINARY_DIR}
|
||||
${FREETYPE_ROOT}/src
|
||||
${FREETYPE_ROOT}
|
||||
PATH_SUFFIXES Debug Release)
|
||||
else()
|
||||
# Find include files
|
||||
find_path(
|
||||
FREETYPE_INCLUDE_DIR
|
||||
NAMES FREETYPE/glfw3.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
DOC "The directory where GL/glfw.h resides")
|
||||
|
||||
# Find library files
|
||||
find_file(
|
||||
FREETYPE_LIBRARY
|
||||
NAMES libglfw${CMAKE_DEBUG_POSTFIX}.so
|
||||
PATHS
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib64
|
||||
/usr/local/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
${FREETYPE_ROOT}/src
|
||||
)
|
||||
endif()
|
||||
|
||||
# Handle REQUIRD argument, define *_FOUND variable
|
||||
find_package_handle_standard_args(FREETYPE DEFAULT_MSG FREETYPE_INCLUDE_DIR FREETYPE_LIBRARY FREETYPE_BINARY)
|
||||
|
||||
# Define FREETYPE_LIBRARIES and FREETYPE_INCLUDE_DIRS
|
||||
if (FREETYPE_FOUND)
|
||||
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
|
||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
# Hide some variables
|
||||
mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_LIBRARY)
|
||||
@@ -0,0 +1,68 @@
|
||||
#
|
||||
# Find TTFPARSER
|
||||
#
|
||||
# Try to find TTFPARSER library.
|
||||
# This module defines the following variables:
|
||||
# - TTFPARSER_INCLUDE_DIRS
|
||||
# - TTFPARSER_LIBRARIES
|
||||
# - TTFPARSER_FOUND
|
||||
#
|
||||
# The following variables can be set as arguments for the module.
|
||||
# - TTFPARSER_ROOT : Root library directory of TTFPARSER
|
||||
# - TTFPARSER_USE_STATIC_LIBS : Specifies to use static version of TTFPARSER library (Windows only)
|
||||
#
|
||||
# References:
|
||||
# - https://github.com/progschj/OpenGL-Examples/blob/master/cmake_modules/FindTTFPARSER.cmake
|
||||
# - https://bitbucket.org/Ident8/cegui-mk2-opengl3-renderer/src/befd47200265/cmake/FindTTFPARSER.cmake
|
||||
#
|
||||
|
||||
# Additional modules
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if (WIN32)
|
||||
# Find include files
|
||||
find_path(
|
||||
TTFPARSER_INCLUDE_DIR
|
||||
NAMES ttfParser.h
|
||||
PATHS
|
||||
$ENV{PROGRAMFILES}/include
|
||||
${TTFPARSER_ROOT}/src
|
||||
DOC "The directory where TTFPARSER/glfw.h resides")
|
||||
|
||||
else()
|
||||
# Find include files
|
||||
find_path(
|
||||
TTFPARSER_INCLUDE_DIR
|
||||
NAMES TTFPARSER/glfw3.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
DOC "The directory where GL/glfw.h resides")
|
||||
|
||||
# Find library files
|
||||
find_file(
|
||||
TTFPARSER_LIBRARY
|
||||
NAMES libglfw${CMAKE_DEBUG_POSTFIX}.so
|
||||
PATHS
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib64
|
||||
/usr/local/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
${TTFPARSER_ROOT}/src
|
||||
)
|
||||
endif()
|
||||
|
||||
# Handle REQUIRD argument, define *_FOUND variable
|
||||
find_package_handle_standard_args(TTFPARSER DEFAULT_MSG TTFPARSER_INCLUDE_DIR)
|
||||
|
||||
# Define TTFPARSER_LIBRARIES and TTFPARSER_INCLUDE_DIRS
|
||||
if (TTFPARSER_FOUND)
|
||||
set(TTFPARSER_INCLUDE_DIRS ${TTFPARSER_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
# Hide some variables
|
||||
mark_as_advanced(TTFPARSER_INCLUDE_DIR)
|
||||
@@ -61,6 +61,11 @@ set(GLFW_VULKAN_STATIC OFF CACHE BOOL "GLFW vulkan static")
|
||||
|
||||
add_subdirectory(${GLFW_ROOT} ${GLFW_ROOT})
|
||||
|
||||
#--------------FreeType------------------------------
|
||||
#list(APPEND DEPENDENCIES freetype)
|
||||
|
||||
#add_subdirectory(${FREETYPE_ROOT} ${FREETYPE_ROOT})
|
||||
|
||||
#--------------SLang------------------------------
|
||||
list(APPEND DEPENDENCIES slang)
|
||||
string(TOLOWER release_${CMAKE_PLATFORM} SLANG_CONFIG)
|
||||
|
||||
Reference in New Issue
Block a user