Merge pull request #2041 from DanOlivier/FreeType-GL

Adding Freetype-GL port
This commit is contained in:
Robert Schumacher 2017-11-06 09:24:53 -08:00 committed by GitHub
commit 771d29df25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,24 @@
From 653dae652bac66e4e96a94ba8ebfabb2227738b7 Mon Sep 17 00:00:00 2001
From: Daniel Olivier <dan_olivier@hotmail.com>
Date: Thu, 19 Oct 2017 21:26:09 -0400
Subject: [PATCH] Use external Glew and Freetype
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4eb55e9..2546de6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,13 +74,6 @@ if(NOT HAVE_M_PI)
endif()
endif()
-if(NOT MINGW AND (WIN32 OR WIN64))
- set(GLEW_ROOT_DIR
- ${CMAKE_CURRENT_SOURCE_DIR}/windows/glew)
- set(ENV{FREETYPE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/windows/freetype)
-endif()
-
find_package(OpenGL REQUIRED)
find_package(Freetype REQUIRED)

View File

@ -0,0 +1,4 @@
Source: freetype-gl
Version: 2017-10-9-82fb152a74f01b1483ac80d15935fbdfaf3ed836
Description: OpenGL text using one vertex buffer, one texture and FreeType
Build-Depends: glew, freetype

View File

@ -0,0 +1,65 @@
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
set(VCPKG_LIBRARY_LINKAGE static)
endif()
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO rougier/freetype-gl
REF 82fb152a74f01b1483ac80d15935fbdfaf3ed836
SHA512 4842d9e66fd25dbb3a4e3f4bf597a0c1fc3c3c30e0cb1baae1c3306ddcb663ff9108d8fc01bde539fea7cb03a6329054f66166d9e448086358ab7b05953f5884
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Use-external-Glew-and-Freetype.patch"
)
# make sure that no "internal" libraries are used by removing them
file(REMOVE_RECURSE ${SOURCE_PATH}/windows/freetype)
file(REMOVE_RECURSE ${SOURCE_PATH}/windows/AntTweakBar)
file(REMOVE_RECURSE ${SOURCE_PATH}/windows/glew)
file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindGLEW.cmake)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-Dfreetype-gl_BUILD_APIDOC=OFF
-Dfreetype-gl_BUILD_DEMOS=OFF
-Dfreetype-gl_BUILD_TESTS=OFF
-Dfreetype-gl_BUILD_MAKEFONT=OFF
)
# We may soon install using a modified cmake process with install target
# Although FreeType-GL uses CMake as its build system, the implementation
# (*.cmake,CMakeLists.txt) doesn't provide for any type of installation.
# Presumably, it has been used as-is, in-tree, without ever needing to install
# itself within a larger system.
vcpkg_build_cmake(LOGFILE_ROOT install)
file(GLOB HEADER_FILES "${SOURCE_PATH}/*.h")
file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/freetype-gl)
# LIB
file(GLOB LIBS
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/*.lib"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/Release/*.lib"
)
file(GLOB DEBUG_LIBS
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/*.lib"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/Debug/*.lib"
)
file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
vcpkg_copy_pdbs()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/freetype-gl RENAME copyright)