Merge pull request #898 from codicodi/add-sdl2-ttf

Add sdl2-ttf
This commit is contained in:
Robert Schumacher 2017-04-05 16:48:17 -07:00 committed by GitHub
commit bf47b51f7b
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.0)
project(SDL2_TTF C)
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
find_library(SDL_LIBRARY SDL2)
find_package(FreeType REQUIRED)
add_library(SDL2_ttf SDL_ttf.c)
target_include_directories(SDL2_ttf PRIVATE ${SDL_INCLUDE_DIR}/SDL2 ${FREETYPE_INCLUDE_DIR_ft2build})
target_link_libraries(SDL2_ttf ${SDL_LIBRARY} ${FREETYPE_LIBRARY})
install(TARGETS SDL2_ttf
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
if(NOT DEFINED SDL_TTF_SKIP_HEADERS)
install(FILES SDL_ttf.h DESTINATION include/SDL2)
endif()
message(STATUS "Link-time dependencies:")
message(STATUS " " ${SDL_LIBRARY})
message(STATUS " " ${FREETYPE_LIBRARY})

4
ports/sdl2-ttf/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: sdl2-ttf
Version: 2.0.14
Description: A library for rendering TrueType fonts with SDL
Build-Depends: sdl2, freetype

View File

@ -0,0 +1,23 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2_ttf-2.0.14)
vcpkg_download_distfile(ARCHIVE
URLS "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz"
FILENAME "SDL2_ttf-2.0.14.tar.gz"
SHA512 4db817573fd216e26180f4c401cc869ce407589a461032fd7167dc612d35e038cca1ab67be7909b6b49c741581a68125ab46362ad8e3c0a2cdd39624ad847099)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG
-DSDL_TTF_SKIP_HEADERS=ON)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-ttf)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-ttf/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-ttf/copyright)