2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

114 lines
3.5 KiB

  1. cmake_minimum_required(VERSION 3.21)
  2. # Set your project name here
  3. project(izanagi C)
  4. set(CMAKE_C_STANDARD 11)
  5. include_directories(
  6. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/include"
  7. "${PROJECT_SOURCE_DIR}/dependencies/minIni/dev"
  8. "${PROJECT_SOURCE_DIR}/dependencies/bdd-for-c"
  9. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/pm_common"
  10. "${PROJECT_SOURCE_DIR}/dependencies/spine-runtimes/spine-c/spine-c/include"
  11. )
  12. if (WIN32)
  13. if (CMAKE_SIZEOF_VOID_P EQUAL 8)
  14. set(PROJECT_ARCH x64)
  15. else ()
  16. set(PROJECT_ARCH x86)
  17. endif ()
  18. endif ()
  19. link_directories(
  20. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}"
  21. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release"
  22. )
  23. add_executable(
  24. game
  25. dependencies/minIni/dev/minIni.h
  26. dependencies/minIni/dev/minIni.c
  27. src/packages/game/output/IZ_video.h
  28. src/packages/game/output/IZ_video.c
  29. src/packages/game/IZ_common.h
  30. src/packages/game/IZ_action.h
  31. src/packages/game/IZ_app.h
  32. src/packages/game/IZ_app.c
  33. src/packages/game/main.c
  34. src/packages/game/input/IZ_joystick.c
  35. src/packages/game/input/IZ_joystick.h
  36. src/packages/game/input/IZ_keyboard.c
  37. src/packages/game/input/IZ_keyboard.h
  38. src/packages/game/IZ_config.c
  39. src/packages/game/IZ_config.h
  40. src/packages/game/geometry/IZ_point2d.c src/packages/game/geometry/IZ_point2d.h src/packages/game/geometry/IZ_vector2d.c src/packages/game/geometry/IZ_vector2d.h src/packages/game/geometry/IZ_rect.c src/packages/game/geometry/IZ_rect.h src/packages/game/core/IZ_object.c src/packages/game/core/IZ_object.h src/packages/game/core/IZ_creature.c src/packages/game/core/IZ_creature.h src/packages/game/core/IZ_entity.c src/packages/game/core/IZ_entity.h src/packages/game/memory/IZ_pool.c src/packages/game/memory/IZ_pool.h)
  41. target_link_libraries(
  42. game
  43. SDL2main
  44. SDL2
  45. )
  46. add_executable(
  47. game-test-geometry
  48. dependencies/bdd-for-c/bdd-for-c.h
  49. src/packages/test/IZ_mock.h
  50. src/packages/test/IZ_test.h
  51. src/packages/game/geometry/IZ_point2d.h
  52. src/packages/game/geometry/IZ_point2d.c
  53. src/packages/game/geometry/IZ_rect.h
  54. src/packages/game/geometry/IZ_rect.c
  55. src/packages/game/geometry/IZ_vector2d.h
  56. src/packages/game/geometry/IZ_vector2d.c
  57. src/packages/game/geometry/geometry.test.c)
  58. add_executable(
  59. game-test-input
  60. dependencies/bdd-for-c/bdd-for-c.h
  61. src/packages/test/IZ_mock.h
  62. src/packages/test/IZ_test.h
  63. __mocks__/minIni.mock.h
  64. __mocks__/SDL_keyboard.mock.h
  65. __mocks__/SDL_events.mock.h
  66. __mocks__/SDL_joystick.mock.h
  67. src/packages/game/IZ_config.h
  68. src/packages/game/__mocks__/IZ_config.mock.h
  69. src/packages/game/input/IZ_keyboard.h
  70. src/packages/game/input/IZ_keyboard.c
  71. src/packages/game/input/IZ_joystick.h
  72. src/packages/game/input/IZ_joystick.c
  73. src/packages/game/input/input.test.c
  74. )
  75. add_executable(
  76. game-test-output
  77. dependencies/bdd-for-c/bdd-for-c.h
  78. src/packages/test/IZ_mock.h
  79. src/packages/test/IZ_test.h
  80. __mocks__/minIni.mock.h
  81. src/packages/game/IZ_config.h
  82. src/packages/game/__mocks__/IZ_config.mock.h
  83. src/packages/game/output/IZ_video.h
  84. src/packages/game/output/IZ_video.c
  85. src/packages/game/output/output.test.c
  86. )
  87. if (WIN32)
  88. add_custom_command(TARGET game POST_BUILD
  89. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  90. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  91. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  92. endif ()