-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (73 loc) · 2.69 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 3.19)
project(font-render-tester)
add_executable(font-render-tester
"src/colors.hpp"
"src/debug_settings.hpp"
"src/draw_glyph.cpp"
"src/draw_glyph.hpp"
"src/font.cpp"
"src/font.hpp"
"src/io_util.hpp"
"src/main_scene.cpp"
"src/main_scene.hpp"
"src/main.cpp"
"src/settings.cpp"
"src/settings.hpp"
"src/text_renderer.cpp"
"src/text_renderer.hpp"
"src/texture.cpp"
"src/texture.hpp"
)
target_include_directories(font-render-tester PRIVATE
"ext/imgui-filebrowser"
"ext/IconFontCppHeaders"
)
target_compile_features(font-render-tester PRIVATE cxx_std_23)
set_property(TARGET font-render-tester PROPERTY CXX_STANDARD 23)
set_property(TARGET font-render-tester PROPERTY CXX_STANDARD_REQUIRED ON)
if (MSVC)
set_property(TARGET font-render-tester PROPERTY WIN32_EXECUTABLE ON)
target_compile_options(font-render-tester PRIVATE /Zc:__cplusplus)
endif ()
find_package(freetype CONFIG REQUIRED)
find_package(harfbuzz CONFIG REQUIRED)
find_package(imgui CONFIG REQUIRED)
find_package(magic_enum CONFIG REQUIRED)
find_package(SDL2 CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(utf8cpp CONFIG REQUIRED)
target_link_libraries(font-render-tester PRIVATE
freetype
harfbuzz::harfbuzz
imgui::imgui
magic_enum::magic_enum
SDL2::SDL2 SDL2::SDL2main
spdlog::spdlog spdlog::spdlog_header_only
utf8::cpp utf8cpp::utf8cpp
)
function(copy_resources)
set(oneValueArgs TARGET TARGET)
set(multiValueArgs TARGET INPUT)
set(oneValueArgs DESTINATION)
cmake_parse_arguments(COPY_RESOURCES "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN}
)
file(GLOB COPY_RESOURCES_INPUT_FILES ${COPY_RESOURCES_INPUT})
add_custom_target(${COPY_RESOURCES_TARGET} ALL
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:font-render-tester>/${COPY_RESOURCES_DESTINATION}/"
COMMAND ${CMAKE_COMMAND} -E copy ${COPY_RESOURCES_INPUT_FILES} "$<TARGET_FILE_DIR:font-render-tester>/${COPY_RESOURCES_DESTINATION}/"
)
endfunction()
copy_resources(
TARGET CopyFontFiles
DESTINATION "fonts"
INPUT
"fonts/forkawesome-webfont.ttf"
"fonts/NotoSans-Regular.ttf"
"fonts/NotoSansArabic-Regular.ttf"
"fonts/NotoSansJP-Regular.ttf"
"fonts/NotoSansKR-Regular.ttf"
"fonts/NotoSansSC-Regular.ttf"
"fonts/NotoSansTC-Regular.ttf"
"fonts/NotoSansThai-Regular.ttf"
)