cmake_minimum_required(VERSION 3.24)
project(hello C)

# Use installed libraries if there are any. If not, download and build them.
include(FetchContent)
FetchContent_Declare(
    SDL3
    GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
    GIT_TAG release-3.4.18
    GIT_SHALLOW TRUE
    FIND_PACKAGE_ARGS 3.4 CONFIG
)

# These settings apply only when CMake must build SDL_ttf.
set(SDLTTF_VENDORED ON)
set(SDLTTF_HARFBUZZ OFF)
set(SDLTTF_PLUTOSVG OFF)
FetchContent_Declare(
    SDL3_ttf
    GIT_REPOSITORY https://github.com/libsdl-org/SDL_ttf.git
    GIT_TAG release-3.2.2
    GIT_SHALLOW TRUE
    GIT_SUBMODULES external/freetype
    FIND_PACKAGE_ARGS CONFIG
)
FetchContent_MakeAvailable(SDL3 SDL3_ttf)

add_executable(hello WIN32 main.c)
target_link_libraries(hello PRIVATE SDL3_ttf::SDL3_ttf SDL3::SDL3)
