33 lines
883 B
CMake
33 lines
883 B
CMake
|
|
include(FetchContent)
|
||
|
|
set(FETCHCONTENT_QUIET FALSE)
|
||
|
|
|
||
|
|
# Download SDL3
|
||
|
|
FetchContent_Declare(
|
||
|
|
SDL3
|
||
|
|
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
||
|
|
GIT_TAG release-3.2.24
|
||
|
|
GIT_SHALLOW TRUE
|
||
|
|
GIT_PROGRESS TRUE
|
||
|
|
)
|
||
|
|
message(STATUS "Using SDL via FetchContent")
|
||
|
|
FetchContent_MakeAvailable(SDL3)
|
||
|
|
set_property(DIRECTORY "${sdl3_SOURCE_DIR}" PROPERTY EXCLUDE_FROM_ALL TRUE)
|
||
|
|
|
||
|
|
# Download SDL_ttf
|
||
|
|
FetchContent_Declare(
|
||
|
|
SDL_ttf
|
||
|
|
GIT_REPOSITORY https://github.com/libsdl-org/SDL_ttf.git
|
||
|
|
GIT_TAG release-3.2.2
|
||
|
|
GIT_SHALLOW TRUE
|
||
|
|
GIT_PROGRESS TRUE
|
||
|
|
)
|
||
|
|
message(STATUS "Using SDL_ttf via FetchContent")
|
||
|
|
FetchContent_MakeAvailable(SDL_ttf)
|
||
|
|
set_property(DIRECTORY "${sdl_ttf_SOURCE_DIR}" PROPERTY EXCLUDE_FROM_ALL TRUE)
|
||
|
|
|
||
|
|
add_executable(SDL main.c)
|
||
|
|
target_link_libraries(SDL PRIVATE
|
||
|
|
SDL3::SDL3
|
||
|
|
SDL3_ttf::SDL3_ttf
|
||
|
|
)
|