first try with cmake and imgui

This commit is contained in:
georgemoralis 2023-04-27 19:13:19 +03:00
parent 71d14aca62
commit 222d0204db
7 changed files with 271 additions and 0 deletions

38
third-party/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,38 @@
#=================== SDL3 ===================
set(SDL3_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL)
add_subdirectory(${SDL3_DIR})
#=================== IMGUI ===================
set(IMGUI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/imgui)
add_library(IMGUI STATIC)
target_sources( IMGUI
PRIVATE
${IMGUI_DIR}/imgui_demo.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
${IMGUI_DIR}/imgui.cpp
PRIVATE
${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp
${IMGUI_DIR}/backends/imgui_impl_sdl3.cpp
)
target_include_directories( IMGUI
PUBLIC ${IMGUI_DIR}
PUBLIC ${IMGUI_DIR}/backends
PUBLIC ${SDL3_DIR}/include
)
find_package(OpenGL REQUIRED)
target_link_libraries(IMGUI PUBLIC ${OPENGL_LIBRARIES})
target_link_libraries(IMGUI PUBLIC SDL3-shared ${CMAKE_DL_LIBS})

1
third-party/SDL vendored Submodule

@ -0,0 +1 @@
Subproject commit eaf17050b4326a9330fac11c21623e5a08026a94

1
third-party/imgui vendored Submodule

@ -0,0 +1 @@
Subproject commit 031e152d292b386b7b6149e455924cfc6bab8c7c