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.
 
 
 
 
 
 

206 lines
6.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. if (WIN32)
  6. if (CMAKE_SIZEOF_VOID_P EQUAL 8)
  7. set(PROJECT_ARCH x64)
  8. else ()
  9. set(PROJECT_ARCH x86)
  10. endif ()
  11. endif ()
  12. include_directories(
  13. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/include"
  14. "${PROJECT_SOURCE_DIR}/dependencies/minIni/dev"
  15. "${PROJECT_SOURCE_DIR}/dependencies/bdd-for-c"
  16. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/pm_common"
  17. "${PROJECT_SOURCE_DIR}/dependencies/spine-runtimes/spine-c/spine-c/include"
  18. "${PROJECT_SOURCE_DIR}/dependencies/getopt-for-windows"
  19. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/include"
  20. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/include"
  21. )
  22. link_directories(
  23. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}"
  24. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release"
  25. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/lib/Release"
  26. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/lib"
  27. )
  28. add_executable(
  29. game
  30. dependencies/minIni/dev/minIni.h
  31. dependencies/minIni/dev/minIni.c
  32. dependencies/getopt-for-windows/getopt.h
  33. dependencies/getopt-for-windows/getopt.c
  34. src/packages/game/output/IZ_video.h
  35. src/packages/game/output/IZ_video.c
  36. src/packages/game/IZ_common.h
  37. src/packages/game/input/IZ_action.h
  38. src/packages/game/IZ_app.h
  39. src/packages/game/IZ_app.c
  40. src/packages/game/main.c
  41. src/packages/game/input/IZ_joystick.c
  42. src/packages/game/input/IZ_joystick.h
  43. src/packages/game/input/IZ_keyboard.c
  44. src/packages/game/input/IZ_keyboard.h
  45. src/packages/game/IZ_config.c
  46. src/packages/game/IZ_config.h
  47. src/packages/game/geometry/IZ_point2d.c
  48. src/packages/game/geometry/IZ_point2d.h
  49. src/packages/game/geometry/IZ_vector2d.c
  50. src/packages/game/geometry/IZ_vector2d.h
  51. src/packages/game/geometry/IZ_rect.c
  52. src/packages/game/geometry/IZ_rect.h
  53. src/packages/game/core/IZ_object.c
  54. src/packages/game/core/IZ_object.h
  55. src/packages/game/core/IZ_creature.c
  56. src/packages/game/core/IZ_creature.h
  57. src/packages/game/core/IZ_entity.c
  58. src/packages/game/core/IZ_entity.h
  59. src/packages/game/memory/IZ_pool.c
  60. src/packages/game/memory/IZ_pool.h
  61. src/packages/game/input/IZ_input.c
  62. src/packages/game/input/IZ_input.h
  63. src/packages/game/input/IZ_midi.c
  64. src/packages/game/input/IZ_midi.h
  65. src/packages/game/data/IZ_list.c
  66. src/packages/game/data/IZ_list.h
  67. )
  68. target_link_libraries(
  69. game
  70. SDL2main
  71. SDL2
  72. portmidi
  73. )
  74. add_executable(
  75. game-test-geometry
  76. dependencies/bdd-for-c/bdd-for-c.h
  77. src/packages/test/IZ_mock.h
  78. src/packages/test/IZ_test.h
  79. src/packages/game/geometry/IZ_point2d.h
  80. src/packages/game/geometry/IZ_point2d.c
  81. src/packages/game/geometry/IZ_rect.h
  82. src/packages/game/geometry/IZ_rect.c
  83. src/packages/game/geometry/IZ_vector2d.h
  84. src/packages/game/geometry/IZ_vector2d.c
  85. src/packages/game/geometry/geometry.test.c
  86. )
  87. add_executable(
  88. game-test-input
  89. dependencies/bdd-for-c/bdd-for-c.h
  90. src/packages/test/IZ_mock.h
  91. src/packages/test/IZ_test.h
  92. __mocks__/minIni.mock.h
  93. __mocks__/SDL_keyboard.mock.h
  94. __mocks__/SDL_events.mock.h
  95. __mocks__/SDL_joystick.mock.h
  96. __mocks__/SDL_stdinc.mock.h
  97. __mocks__/portmidi.mock.h
  98. src/packages/game/IZ_config.h
  99. src/packages/game/input/IZ_keyboard.h
  100. src/packages/game/input/IZ_keyboard.c
  101. src/packages/game/input/IZ_joystick.h
  102. src/packages/game/input/IZ_joystick.c
  103. src/packages/game/input/IZ_midi.h
  104. src/packages/game/input/IZ_midi.c
  105. src/packages/game/input/input.test.c
  106. )
  107. add_executable(
  108. game-test-output
  109. dependencies/bdd-for-c/bdd-for-c.h
  110. src/packages/test/IZ_mock.h
  111. src/packages/test/IZ_test.h
  112. __mocks__/minIni.mock.h
  113. __mocks__/SDL_stdinc.mock.h
  114. __mocks__/SDL_render.mock.h
  115. src/packages/game/IZ_config.h
  116. src/packages/game/output/IZ_video.h
  117. src/packages/game/output/IZ_video.c
  118. src/packages/game/output/output.test.c
  119. )
  120. add_executable(
  121. game-test-memory
  122. dependencies/bdd-for-c/bdd-for-c.h
  123. src/packages/test/IZ_mock.h
  124. src/packages/test/IZ_test.h
  125. src/packages/game/memory/IZ_pool.h
  126. src/packages/game/memory/IZ_pool.c
  127. src/packages/game/memory/memory.test.c
  128. src/packages/game/data/IZ_list.c
  129. src/packages/game/data/IZ_list.h
  130. )
  131. add_executable(
  132. game-test-data
  133. dependencies/bdd-for-c/bdd-for-c.h
  134. src/packages/test/IZ_mock.h
  135. src/packages/test/IZ_test.h
  136. src/packages/game/data/IZ_list.h
  137. src/packages/game/data/IZ_list.c
  138. src/packages/game/data/data.test.c
  139. )
  140. add_executable(
  141. server
  142. dependencies/minIni/dev/minIni.h
  143. dependencies/minIni/dev/minIni.c
  144. src/packages/server/IZ_common.h
  145. src/packages/server/main.c
  146. src/packages/server/protocol_lws_minimal.c)
  147. target_link_libraries(
  148. server
  149. libcrypto
  150. libssl
  151. websockets
  152. )
  153. if (WIN32)
  154. add_custom_command(TARGET game POST_BUILD
  155. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  156. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  157. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  158. add_custom_command(TARGET game POST_BUILD
  159. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  160. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release/portmidi.dll" # <--this is in-file
  161. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  162. add_custom_command(TARGET server POST_BUILD
  163. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  164. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/bin/Release/websockets.dll" # <--this is in-file
  165. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  166. add_custom_command(TARGET server POST_BUILD
  167. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  168. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" # <--this is in-file
  169. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  170. add_custom_command(TARGET server POST_BUILD
  171. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  172. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" # <--this is in-file
  173. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  174. endif ()