2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

CMakeLists.txt 4.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. "${PROJECT_SOURCE_DIR}/dependencies/getopt-for-windows"
  12. )
  13. if (WIN32)
  14. if (CMAKE_SIZEOF_VOID_P EQUAL 8)
  15. set(PROJECT_ARCH x64)
  16. else ()
  17. set(PROJECT_ARCH x86)
  18. endif ()
  19. endif ()
  20. link_directories(
  21. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}"
  22. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release"
  23. )
  24. add_executable(
  25. game
  26. dependencies/minIni/dev/minIni.h
  27. dependencies/minIni/dev/minIni.c
  28. dependencies/getopt-for-windows/getopt.h
  29. dependencies/getopt-for-windows/getopt.c
  30. src/packages/game/output/IZ_video.h
  31. src/packages/game/output/IZ_video.c
  32. src/packages/game/IZ_common.h
  33. src/packages/game/input/IZ_action.h
  34. src/packages/game/IZ_app.h
  35. src/packages/game/IZ_app.c
  36. src/packages/game/main.c
  37. src/packages/game/input/IZ_joystick.c
  38. src/packages/game/input/IZ_joystick.h
  39. src/packages/game/input/IZ_keyboard.c
  40. src/packages/game/input/IZ_keyboard.h
  41. src/packages/game/IZ_config.c
  42. src/packages/game/IZ_config.h
  43. 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 src/packages/game/input/IZ_input.c src/packages/game/input/IZ_input.h src/packages/game/input/IZ_midi.c src/packages/game/input/IZ_midi.h src/packages/game/data/IZ_list.c src/packages/game/data/IZ_list.h)
  44. target_link_libraries(
  45. game
  46. SDL2main
  47. SDL2
  48. portmidi
  49. )
  50. add_executable(
  51. game-test-geometry
  52. dependencies/bdd-for-c/bdd-for-c.h
  53. src/packages/test/IZ_mock.h
  54. src/packages/test/IZ_test.h
  55. src/packages/game/geometry/IZ_point2d.h
  56. src/packages/game/geometry/IZ_point2d.c
  57. src/packages/game/geometry/IZ_rect.h
  58. src/packages/game/geometry/IZ_rect.c
  59. src/packages/game/geometry/IZ_vector2d.h
  60. src/packages/game/geometry/IZ_vector2d.c
  61. src/packages/game/geometry/geometry.test.c)
  62. add_executable(
  63. game-test-input
  64. dependencies/bdd-for-c/bdd-for-c.h
  65. src/packages/test/IZ_mock.h
  66. src/packages/test/IZ_test.h
  67. __mocks__/minIni.mock.h
  68. __mocks__/SDL_keyboard.mock.h
  69. __mocks__/SDL_events.mock.h
  70. __mocks__/SDL_joystick.mock.h
  71. __mocks__/SDL_stdinc.mock.h
  72. src/packages/game/IZ_config.h
  73. src/packages/game/input/IZ_keyboard.h
  74. src/packages/game/input/IZ_keyboard.c
  75. src/packages/game/input/IZ_joystick.h
  76. src/packages/game/input/IZ_joystick.c
  77. src/packages/game/input/input.test.c
  78. )
  79. add_executable(
  80. game-test-output
  81. dependencies/bdd-for-c/bdd-for-c.h
  82. src/packages/test/IZ_mock.h
  83. src/packages/test/IZ_test.h
  84. __mocks__/minIni.mock.h
  85. __mocks__/SDL_stdinc.mock.h
  86. __mocks__/SDL_render.mock.h
  87. src/packages/game/IZ_config.h
  88. src/packages/game/output/IZ_video.h
  89. src/packages/game/output/IZ_video.c
  90. src/packages/game/output/output.test.c
  91. )
  92. add_executable(
  93. game-test-memory
  94. dependencies/bdd-for-c/bdd-for-c.h
  95. src/packages/test/IZ_mock.h
  96. src/packages/test/IZ_test.h
  97. src/packages/game/memory/IZ_pool.h
  98. src/packages/game/memory/IZ_pool.c
  99. src/packages/game/memory/memory.test.c src/packages/game/data/IZ_list.c src/packages/game/data/IZ_list.h)
  100. add_executable(
  101. game-test-data
  102. dependencies/bdd-for-c/bdd-for-c.h
  103. src/packages/test/IZ_mock.h
  104. src/packages/test/IZ_test.h
  105. src/packages/game/data/IZ_list.h
  106. src/packages/game/data/IZ_list.c
  107. src/packages/game/data/data.test.c)
  108. if (WIN32)
  109. add_custom_command(TARGET game POST_BUILD
  110. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  111. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  112. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  113. endif ()
  114. if (WIN32)
  115. add_custom_command(TARGET game POST_BUILD
  116. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  117. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release/portmidi.dll" # <--this is in-file
  118. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  119. endif ()