ugfx/drivers/multiple/SDL/driver.cmake

49 lines
858 B
CMake
Raw Permalink Normal View History

2021-10-12 15:44:54 +00:00
set(ROOT_PATH ${UGFX_ROOT}/drivers/multiple/SDL)
2023-06-07 13:24:51 +00:00
# Defaults
if (NOT UGFX_DEPENDENCY_SDL2_DOWNLOAD)
set(UGFX_DEPENDENCY_SDL2_DOWNLOAD OFF)
endif()
# Get or find SDL2
if (UGFX_DEPENDENCY_SDL2_DOWNLOAD)
include(FetchContent)
FetchContent_Declare(
SDL2
GIT_REPOSITORY https://github.com/libsdl-org/SDL
GIT_TAG release-2.26.5
)
FetchContent_MakeAvailable(SDL2)
if (NOT UGFX_DEPENDENCY_SDL2_TARGET)
set(UGFX_DEPENDENCY_SDL2_TARGET SDL2-static)
endif()
else()
find_package(
SDL2
REQUIRED
)
if (NOT UGFX_DEPENDENCY_SDL2_TARGET)
set(UGFX_DEPENDENCY_SDL2_TARGET SDL2::SDL2)
endif()
endif()
2021-10-12 15:44:54 +00:00
list(APPEND ugfx_INCLUDE_DIRS
${ROOT_PATH}
)
list(APPEND ugfx_SOURCES
${ROOT_PATH}/gdisp_lld_SDL.c
)
list(APPEND ugfx_DEFS
GFX_OS_PRE_INIT_FUNCTION=sdl_driver_init
)
2021-10-28 14:15:02 +00:00
list(APPEND ugfx_LIBS
2023-06-07 13:24:51 +00:00
${UGFX_DEPENDENCY_SDL2_TARGET}
2021-10-12 15:44:54 +00:00
)