CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Testbed configuration
  2. include(FetchContent)
  3. # Fetch SDL3
  4. FetchContent_Declare(
  5. SDL3
  6. GIT_REPOSITORY https://github.com/libsdl-org/SDL
  7. GIT_TAG release-3.2.10
  8. GIT_SHALLOW 1
  9. )
  10. option(SDL_STATIC "Enable SDL static library" ON)
  11. option(SDL_SHARED "Disable SDL shared library" OFF)
  12. FetchContent_MakeAvailable(SDL3)
  13. # Fetch ImGui
  14. FetchContent_Declare(
  15. imgui
  16. GIT_REPOSITORY https://github.com/ocornut/imgui
  17. GIT_TAG v1.91.9
  18. GIT_SHALLOW 1
  19. )
  20. FetchContent_MakeAvailable(imgui)
  21. # Testbed executable
  22. add_executable(testbed)
  23. set_target_properties(testbed PROPERTIES CXX_EXTENSIONS OFF)
  24. target_compile_features(testbed PUBLIC ${ENTT_CXX_STD})
  25. target_compile_definitions(
  26. testbed
  27. PRIVATE
  28. ENTT_ID_TYPE=${ENTT_ID_TYPE}
  29. NOMINMAX
  30. )
  31. target_sources(
  32. testbed
  33. PRIVATE
  34. application/application.cpp
  35. application/context.cpp
  36. meta/meta.cpp
  37. system/hud_system.cpp
  38. system/imgui_system.cpp
  39. system/input_system.cpp
  40. system/rendering_system.cpp
  41. testbed.cpp
  42. ${imgui_SOURCE_DIR}/backends/imgui_impl_sdl3.cpp
  43. ${imgui_SOURCE_DIR}/backends/imgui_impl_sdlrenderer3.cpp
  44. ${imgui_SOURCE_DIR}/imgui.cpp
  45. ${imgui_SOURCE_DIR}/imgui_demo.cpp
  46. ${imgui_SOURCE_DIR}/imgui_draw.cpp
  47. ${imgui_SOURCE_DIR}/imgui_tables.cpp
  48. ${imgui_SOURCE_DIR}/imgui_widgets.cpp
  49. )
  50. target_link_libraries(
  51. testbed
  52. PRIVATE
  53. EnTT::EnTT
  54. SDL3::SDL3
  55. )
  56. target_include_directories(
  57. testbed
  58. PRIVATE
  59. ${CMAKE_CURRENT_SOURCE_DIR}
  60. ${imgui_SOURCE_DIR}
  61. )