-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (31 loc) · 1.14 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
cmake_minimum_required(VERSION 3.20)
project(english-text-web-win-sdl3-c LANGUAGES C)
add_executable(app)
# Specify where the application source files are stored
target_sources(app
PRIVATE
src/main.c
)
# Check for WebAssembly
if (CMAKE_SYSTEM_NAME MATCHES "Emscripten")
target_link_options("app" PRIVATE "SHELL:--embed-file ${CMAKE_CURRENT_SOURCE_DIR}/assets/fonts/arial.ttf@/assets/fonts/arial.ttf")
set_property(TARGET "app" APPEND PROPERTY LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/assets/fonts/arial.ttf")
endif()
# Check for Windows
if (WIN32)
# Copy the assets folder to the dist folder
add_custom_command(TARGET app POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/assets $<TARGET_FILE_DIR:app>/assets)
# This code copies DLL's to the dist directory
#[===[
add_custom_command(TARGET app POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_RUNTIME_DLLS:app> $<TARGET_FILE_DIR:app>
)
]===]
target_link_options(app PRIVATE -static)
endif()
find_package(SDL3)
find_package(SDL3_ttf)
target_link_libraries(app PRIVATE SDL3_ttf::SDL3_ttf SDL3::SDL3)