mirror of
https://github.com/cimgui/cimgui.git
synced 2026-03-20 04:51:18 +00:00
37 lines
878 B
CMake
37 lines
878 B
CMake
cmake_minimum_required(VERSION 3.30)
|
|
project(cimgui_sdlrenderer3 LANGUAGES C CXX)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
sdl3
|
|
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
|
GIT_TAG release-3.4.0
|
|
#GIT_SHALLOW TRUE
|
|
GIT_PROGRESS TRUE
|
|
)
|
|
|
|
set(SDL_TEST_LIBRARY OFF CACHE BOOL "" FORCE)
|
|
FetchContent_MakeAvailable(sdl3)
|
|
|
|
include(../cmake/GenerateCimguiBindings.cmake)
|
|
|
|
set(inclulist ${sdl3_SOURCE_DIR}/include)
|
|
GenerateCimguiBindings(cimgui_with_backend sdl3 sdlrenderer3 inclulist)
|
|
target_link_libraries(cimgui_with_backend PRIVATE SDL3::SDL3)
|
|
|
|
add_executable(${PROJECT_NAME}
|
|
main.c
|
|
)
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE SDL3::SDL3 cimgui_with_backend)
|
|
target_compile_definitions(
|
|
${PROJECT_NAME}
|
|
PRIVATE
|
|
CIMGUI_DEFINE_ENUMS_AND_STRUCTS=1
|
|
CIMGUI_USE_SDL3=1
|
|
CIMGUI_USE_SDLRENDERER3=1
|
|
)
|