1
0

CMakeLists.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_GetProperties(imgui)
  21. if(NOT imgui_POPULATED)
  22. FetchContent_Populate(imgui)
  23. set(imgui_INCLUDE_DIR ${imgui_SOURCE_DIR})
  24. endif()
  25. # Testbed executable
  26. add_executable(testbed)
  27. set_target_properties(testbed PROPERTIES CXX_EXTENSIONS OFF)
  28. target_compile_features(testbed PUBLIC ${ENTT_CXX_STD})
  29. target_compile_definitions(
  30. testbed
  31. PRIVATE
  32. ENTT_ID_TYPE=${ENTT_ID_TYPE}
  33. NOMINMAX
  34. )
  35. target_sources(
  36. testbed
  37. PRIVATE
  38. application/application.cpp
  39. application/context.cpp
  40. meta/meta.cpp
  41. system/hud_system.cpp
  42. system/imgui_system.cpp
  43. system/input_system.cpp
  44. system/rendering_system.cpp
  45. testbed.cpp
  46. ${imgui_SOURCE_DIR}/backends/imgui_impl_sdl3.cpp
  47. ${imgui_SOURCE_DIR}/backends/imgui_impl_sdlrenderer3.cpp
  48. ${imgui_SOURCE_DIR}/imgui.cpp
  49. ${imgui_SOURCE_DIR}/imgui_demo.cpp
  50. ${imgui_SOURCE_DIR}/imgui_draw.cpp
  51. ${imgui_SOURCE_DIR}/imgui_tables.cpp
  52. ${imgui_SOURCE_DIR}/imgui_widgets.cpp
  53. )
  54. target_link_libraries(
  55. testbed
  56. PRIVATE
  57. EnTT::EnTT
  58. SDL3::SDL3
  59. )
  60. target_include_directories(
  61. testbed
  62. PRIVATE
  63. ${CMAKE_CURRENT_SOURCE_DIR}
  64. ${imgui_SOURCE_DIR}
  65. )