Skip to content

Commit bb151db

Browse files
committed
Add MakeSpriteFont to CMake build
1 parent 6bfda20 commit bb151db

4 files changed

Lines changed: 60 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,15 @@ jobs:
7070
- toolver: '14'
7171
build_type: x86-Release-Clang
7272
arch: amd64_x86
73+
- toolver: '14'
74+
build_type: x64-Debug-VS
75+
arch: amd64
76+
- toolver: '14'
77+
build_type: x86-Debug-VS
78+
arch: amd64_x86
7379

7480
steps:
75-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
81+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7682

7783
- name: 'Install Ninja'
7884
run: choco install ninja

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@ if(TOOL_EXES)
446446
message(STATUS "Building tools: ${TOOL_EXES}")
447447
endif()
448448

449+
if (BUILD_TOOLS AND (CMAKE_GENERATOR MATCHES "Visual Studio"))
450+
add_subdirectory(MakeSpriteFont)
451+
endif()
452+
449453
# Model uses dynamic_cast, so we need /GR (Enable RTTI)
450454
if(MSVC)
451455
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})

CMakePresets.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
"binaryDir": "${sourceDir}/out/build/${presetName}",
1515
"installDir": "${sourceDir}/out/install/${presetName}"
1616
},
17+
{
18+
"name": "vsbase",
19+
"displayName": "Visual Studio Basic Config",
20+
"description": "Basic build using Visual Studio generator",
21+
"generator": "Visual Studio 17 2022",
22+
"hidden": true,
23+
"binaryDir": "${sourceDir}/out/build/${presetName}",
24+
"installDir": "${sourceDir}/out/install/${presetName}"
25+
},
1726
{
1827
"name": "x64",
1928
"architecture": {
@@ -249,6 +258,11 @@
249258
{ "name": "x86-Debug" , "description": "MSVC for x86 (Debug) for Windows 8", "inherits": [ "base", "x86", "Debug", "MSVC" ] },
250259
{ "name": "x86-Release" , "description": "MSVC for x86 (Release) for Windows 8", "inherits": [ "base", "x86", "Release", "MSVC" ] },
251260

261+
{ "name": "x64-Debug-VS" , "description": "MSVC for x64 (Debug) w/ MakeSpriteFont", "inherits": [ "vsbase", "x64", "Debug", "MSVC" ] },
262+
{ "name": "x64-Release-VS" , "description": "MSVC for x64 (Release) w/ MakeSpriteFont", "inherits": [ "vsbase", "x64", "Release", "MSVC" ] },
263+
{ "name": "x86-Debug-VS" , "description": "MSVC for x86 (Debug) w/ MakeSpriteFont", "inherits": [ "vsbase", "x86", "Debug", "MSVC" ] },
264+
{ "name": "x86-Release-VS" , "description": "MSVC for x86 (Release) w/ MakeSpriteFont", "inherits": [ "vsbase", "x86", "Release", "MSVC" ] },
265+
252266
{ "name": "x64-Debug-Win10" , "description": "MSVC for x64 (Debug) for Windows 10", "inherits": [ "base", "x64", "Debug", "MSVC", "Win10" ] },
253267
{ "name": "x64-Release-Win10" , "description": "MSVC for x64 (Release) for Windows 10", "inherits": [ "base", "x64", "Release", "MSVC", "Win10" ] },
254268
{ "name": "x86-Debug-Win10" , "description": "MSVC for x86 (Debug) for Windows 10", "inherits": [ "base", "x86", "Debug", "MSVC", "Win10" ] },

MakeSpriteFont/CMakeLists.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
cmake_minimum_required (VERSION 3.21)
5+
6+
project (MakeSpriteFont
7+
DESCRIPTION "DirectX Tool Kit SpriteFont tool"
8+
HOMEPAGE_URL "https://github.com/microsoft/DirectXTK"
9+
LANGUAGES CSharp)
10+
11+
add_executable(${PROJECT_NAME}
12+
BitmapImporter.cs
13+
BitmapUtils.cs
14+
CharacterRegion.cs
15+
CommandLineOptions.cs
16+
CommandLineParser.cs
17+
Glyph.cs
18+
GlyphCropper.cs
19+
GlyphPacker.cs
20+
IFontImporter.cs
21+
Program.cs
22+
Properties/AssemblyInfo.cs
23+
SpriteFontWriter.cs
24+
TrueTypeImporter.cs)
25+
26+
set_property(TARGET ${PROJECT_NAME}
27+
PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.7.2"
28+
PROPERTY WIN32_EXECUTABLE TRUE)
29+
30+
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCES
31+
"Microsoft.CSharp"
32+
"System"
33+
"System.Drawing")
34+
35+
set(CMAKE_CSharp_FLAGS "/platform:AnyCPU")

0 commit comments

Comments
 (0)