Skip to content

Commit d226ba1

Browse files
authored
Add 'freetype-gl' package (#249)
1 parent 3fb64fc commit d226ba1

8 files changed

Lines changed: 100 additions & 0 deletions

File tree

cmake/configs/default.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ hunter_default_version(flex VERSION 2.6.4)
272272
hunter_default_version(fmt VERSION 6.1.2)
273273
hunter_default_version(folly VERSION 2018.10.22.00-p4)
274274
hunter_default_version(freetype VERSION 2.9.1-p3)
275+
hunter_default_version(freetype-gl VERSION 0.0.0-1a8c007-p0)
275276
hunter_default_version(frugally-deep VERSION 0.2.2-p0)
276277
hunter_default_version(gRPC VERSION 1.31.0-p0)
277278
hunter_default_version(gauze VERSION 0.7.1)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Install packages
2+
sudo apt-get install -y libgl1-mesa-dev
3+
4+
bash .github/workflows/ci/build.sh
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[
2+
{ "example": "freetype-gl", "toolchain": "clang-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
3+
{ "example": "freetype-gl", "toolchain": "gcc-7-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
4+
{ "example": "freetype-gl", "toolchain": "gcc-8-cxx17-fpic", "os": "ubuntu-18.04", "python": "3.8", "script": "build.sh" },
5+
{ "example": "freetype-gl", "toolchain": "gcc-9-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" },
6+
{ "example": "freetype-gl", "toolchain": "sanitize-address-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
7+
{ "example": "freetype-gl", "toolchain": "sanitize-leak-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
8+
{ "example": "freetype-gl", "toolchain": "sanitize-thread-cxx17", "os": "ubuntu-16.04", "python": "3.8", "script": "build.sh" },
9+
{ "example": "freetype-gl", "toolchain": "ninja-vs-15-2017-win64-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
10+
{ "example": "freetype-gl", "toolchain": "nmake-vs-15-2017-win64-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
11+
{ "example": "freetype-gl", "toolchain": "vs-16-2019-win64-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" },
12+
{ "example": "freetype-gl", "toolchain": "vs-15-2017-win64-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
13+
{ "example": "freetype-gl", "toolchain": "vs-14-2015-sdk-8-1", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
14+
{ "example": "freetype-gl", "toolchain": "mingw-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" },
15+
{ "example": "freetype-gl", "toolchain": "msys-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" }
16+
]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# !!! DO NOT PLACE HEADER GUARDS HERE !!!
2+
3+
include(hunter_add_version)
4+
include(hunter_cacheable)
5+
include(hunter_cmake_args)
6+
include(hunter_download)
7+
include(hunter_pick_scheme)
8+
9+
hunter_add_version(
10+
PACKAGE_NAME
11+
freetype-gl
12+
VERSION
13+
"0.0.0-1a8c007-p0" #project has no releases so using 0.0.0-commit-patch
14+
URL
15+
"https://github.com/cpp-pm/freetype-gl/archive/v0.0.0-1a8c007-p0.tar.gz"
16+
SHA1
17+
923b6a4fad097beefa6aa6c759e7fa4010bf9214
18+
)
19+
20+
hunter_cmake_args(
21+
freetype-gl
22+
CMAKE_ARGS
23+
freetype-gl_USE_HUNTER=ON
24+
freetype-gl_BUILD_DEMOS=OFF
25+
freetype-gl_BUILD_TESTS=OFF
26+
freetype-gl_BUILD_APIDOC=OFF
27+
freetype-gl_BUILD_MAKEFONT=OFF
28+
)
29+
30+
hunter_pick_scheme(DEFAULT url_sha1_cmake)
31+
hunter_cacheable(freetype-gl)
32+
hunter_download(PACKAGE_NAME freetype-gl)

docs/packages/graphics.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.. spelling::
22

33
freetype
4+
opengl
45
shaders
56

67
Graphics 2D/3D
@@ -9,6 +10,7 @@ Graphics 2D/3D
910
- :ref:`pkg.aglet` - Tiny cross platform (headless) OpenGL context creation
1011
- :ref:`pkg.Assimp` - portable Open Source library to import various well-known 3D model formats in a uniform manner
1112
- :ref:`pkg.freetype` - render freetype fonts
13+
- :ref:`pkg.freetype-gl` - render freetype fonts in opengl
1214
- :ref:`pkg.glew` - The OpenGL Extension Wrangler Library
1315
- :ref:`pkg.imgui` - Immediate-mode, bloat-free graphical user interface library for C++
1416
- :ref:`pkg.mojoshader` - MojoShader is a library to work with Direct3D shaders on alternate 3D APIs and non-Windows platforms

docs/packages/pkg/freetype-gl.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. spelling::
2+
3+
freetype
4+
freetype-gl
5+
gl
6+
7+
.. index:: graphics ; freetype-gl
8+
9+
.. _pkg.freetype-gl:
10+
11+
freetype-gl
12+
===========
13+
14+
- `Official <https://github.com/rougier/freetype-gl>`__
15+
- `Hunterized <https://github.com/cpp-pm/freetype-gl>`__
16+
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/freetype-gl/CMakeLists.txt>`__
17+
(`pr-249 <https://github.com/cpp-pm/hunter/pull/249>`__)
18+
19+
.. literalinclude:: /../examples/freetype-gl/CMakeLists.txt
20+
:language: cmake
21+
:start-after: # DOCUMENTATION_START {
22+
:end-before: # DOCUMENTATION_END }
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cmake_minimum_required(VERSION 3.0)
2+
3+
# Emulate HunterGate:
4+
# * https://github.com/hunter-packages/gate
5+
include("../common.cmake")
6+
7+
project(download-freetype-gl)
8+
9+
# DOCUMENTATION_START {
10+
hunter_add_package(freetype-gl)
11+
find_package(freetype-gl CONFIG REQUIRED)
12+
13+
add_executable(freetype-gl-example main.cpp)
14+
target_link_libraries(freetype-gl-example PRIVATE freetype-gl::freetype-gl)
15+
# DOCUMENTATION_END }

examples/freetype-gl/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include "freetype-gl/freetype-gl.h"
2+
3+
int main()
4+
{
5+
texture_glyph_t *emptyGlyph=texture_glyph_new();
6+
7+
return 1;
8+
}

0 commit comments

Comments
 (0)