2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

267 lines
9.2 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. add_definitions(
  13. -DIZ_APP_NAME="Izanagi"
  14. -DIZ_APP_DESCRIPTION="Run and gun game"
  15. -DIZ_APP_SERVER_DESCRIPTION="Dedicated server"
  16. -DIZ_PLAYERS=2
  17. )
  18. if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
  19. add_definitions(-DIZ_DEBUG)
  20. endif()
  21. include_directories(
  22. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/include"
  23. "${PROJECT_SOURCE_DIR}/dependencies/minIni/dev"
  24. "${PROJECT_SOURCE_DIR}/dependencies/bdd-for-c"
  25. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/pm_common"
  26. "${PROJECT_SOURCE_DIR}/dependencies/spine-runtimes/spine-c/spine-c/include"
  27. "${PROJECT_SOURCE_DIR}/dependencies/getopt-for-windows"
  28. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/include"
  29. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/include"
  30. "${PROJECT_SOURCE_DIR}/dependencies/sqlite"
  31. )
  32. link_directories(
  33. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}"
  34. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release"
  35. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/lib/Release"
  36. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/lib"
  37. )
  38. add_executable(
  39. game
  40. dependencies/minIni/dev/minIni.h
  41. dependencies/minIni/dev/minIni.c
  42. dependencies/getopt-for-windows/getopt.h
  43. dependencies/getopt-for-windows/getopt.c
  44. src/packages/game/output/video/IZ_video.h
  45. src/packages/game/output/video/IZ_video.c
  46. src/packages/common/IZ_common.h
  47. src/packages/game/input/IZ_action.h
  48. src/packages/game/IZ_app.h
  49. src/packages/game/IZ_app.c
  50. src/packages/game/main.c
  51. src/packages/game/input/IZ_joystick.c
  52. src/packages/game/input/IZ_joystick.h
  53. src/packages/game/input/IZ_keyboard.c
  54. src/packages/game/input/IZ_keyboard.h
  55. src/packages/config/IZ_config.c
  56. src/packages/config/IZ_config.h
  57. src/packages/game/geometry/IZ_point2d.c
  58. src/packages/game/geometry/IZ_point2d.h
  59. src/packages/game/geometry/IZ_vector2d.c
  60. src/packages/game/geometry/IZ_vector2d.h
  61. src/packages/game/geometry/IZ_rect.c
  62. src/packages/game/geometry/IZ_rect.h
  63. src/packages/game/core/IZ_object.c
  64. src/packages/game/core/IZ_object.h
  65. src/packages/game/core/IZ_creature.c
  66. src/packages/game/core/IZ_creature.h
  67. src/packages/game/core/IZ_entity.c
  68. src/packages/game/core/IZ_entity.h
  69. src/packages/game/memory/IZ_pool.c
  70. src/packages/game/memory/IZ_pool.h
  71. src/packages/game/input/IZ_input.c
  72. src/packages/game/input/IZ_input.h
  73. src/packages/game/input/IZ_midi.c
  74. src/packages/game/input/IZ_midi.h
  75. src/packages/game/data/IZ_list.c
  76. src/packages/game/data/IZ_list.h
  77. src/packages/net/svc/IZ_wsclient.c
  78. src/packages/net/svc/IZ_wsclient.h
  79. src/packages/log/IZ_log.c
  80. src/packages/log/IZ_log.h
  81. src/packages/game/util/IZ_midi.c
  82. src/packages/game/util/IZ_midi.h
  83. src/packages/net/core/IZ_websocket.h
  84. src/packages/net/core/IZ_websocket.c
  85. src/packages/net/IZ_net_client.c src/packages/net/IZ_net_client.h src/packages/game/IZ_app_net.c src/packages/game/IZ_app_net.h src/packages/game/IZ_app_video.c src/packages/game/IZ_app_video.h src/packages/game/IZ_subsystem.h src/packages/game/IZ_app_input.c src/packages/game/IZ_app_input.h src/packages/game/IZ_app_config.c src/packages/game/IZ_app_config.h)
  86. target_link_libraries(
  87. game
  88. SDL2main
  89. SDL2
  90. portmidi
  91. libcrypto
  92. libssl
  93. websockets
  94. )
  95. add_executable(
  96. game-test-geometry
  97. dependencies/bdd-for-c/bdd-for-c.h
  98. src/packages/test/IZ_mock.h
  99. src/packages/test/IZ_test.h
  100. src/packages/game/geometry/IZ_point2d.h
  101. src/packages/game/geometry/IZ_point2d.c
  102. src/packages/game/geometry/IZ_rect.h
  103. src/packages/game/geometry/IZ_rect.c
  104. src/packages/game/geometry/IZ_vector2d.h
  105. src/packages/game/geometry/IZ_vector2d.c
  106. src/packages/game/geometry/geometry.test.c
  107. )
  108. add_executable(
  109. game-test-input
  110. dependencies/bdd-for-c/bdd-for-c.h
  111. src/packages/test/IZ_mock.h
  112. src/packages/test/IZ_test.h
  113. __mocks__/minIni.mock.h
  114. __mocks__/SDL_keyboard.mock.h
  115. __mocks__/SDL_events.mock.h
  116. __mocks__/SDL_joystick.mock.h
  117. __mocks__/SDL_stdinc.mock.h
  118. __mocks__/portmidi.mock.h
  119. src/packages/config/IZ_config.h
  120. src/packages/game/input/IZ_keyboard.h
  121. src/packages/game/input/IZ_keyboard.c
  122. src/packages/game/input/IZ_joystick.h
  123. src/packages/game/input/IZ_joystick.c
  124. src/packages/game/input/IZ_midi.h
  125. src/packages/game/input/IZ_midi.c
  126. src/packages/game/util/IZ_midi.c
  127. src/packages/game/util/IZ_midi.h
  128. src/packages/game/input/input.test.c
  129. )
  130. add_executable(
  131. game-test-output
  132. dependencies/bdd-for-c/bdd-for-c.h
  133. src/packages/test/IZ_mock.h
  134. src/packages/test/IZ_test.h
  135. __mocks__/minIni.mock.h
  136. __mocks__/SDL_stdinc.mock.h
  137. __mocks__/SDL_render.mock.h
  138. src/packages/config/IZ_config.h
  139. src/packages/game/output/video/IZ_video.h
  140. src/packages/game/output/video/IZ_video.c
  141. src/packages/game/output/output.test.c
  142. )
  143. add_executable(
  144. game-test-memory
  145. dependencies/bdd-for-c/bdd-for-c.h
  146. src/packages/test/IZ_mock.h
  147. src/packages/test/IZ_test.h
  148. src/packages/game/memory/IZ_pool.h
  149. src/packages/game/memory/IZ_pool.c
  150. src/packages/game/memory/memory.test.c
  151. src/packages/game/data/IZ_list.c
  152. src/packages/game/data/IZ_list.h
  153. )
  154. add_executable(
  155. game-test-data
  156. dependencies/bdd-for-c/bdd-for-c.h
  157. src/packages/test/IZ_mock.h
  158. src/packages/test/IZ_test.h
  159. src/packages/game/data/IZ_list.h
  160. src/packages/game/data/IZ_list.c
  161. src/packages/game/data/data.test.c
  162. )
  163. add_executable(
  164. server
  165. dependencies/sqlite/sqlite3.h
  166. dependencies/sqlite/sqlite3.c
  167. dependencies/minIni/dev/minIni.h
  168. dependencies/minIni/dev/minIni.c
  169. src/packages/log/IZ_log.h
  170. src/packages/log/IZ_log.c
  171. src/packages/server/main.c
  172. src/packages/server/IZ_app.c
  173. src/packages/server/IZ_app.h
  174. src/packages/server/IZ_app_config.h
  175. src/packages/server/IZ_app_config.c
  176. src/packages/net/svc/IZ_wsserver.c
  177. src/packages/net/svc/IZ_wsserver.h
  178. src/packages/net/core/IZ_websocket.h
  179. src/packages/net/core/IZ_websocket.c
  180. src/packages/config/IZ_config.h
  181. src/packages/config/IZ_config.c
  182. src/packages/net/IZ_net_server.c
  183. src/packages/net/IZ_net_server.h
  184. src/packages/server/db/IZ_repo.c
  185. src/packages/server/db/IZ_repo.h
  186. src/packages/server/IZ_subsystem.h
  187. )
  188. target_link_libraries(
  189. server
  190. SDL2main
  191. SDL2
  192. libcrypto
  193. libssl
  194. websockets
  195. )
  196. if (WIN32)
  197. add_custom_command(TARGET game POST_BUILD
  198. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  199. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  200. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  201. add_custom_command(TARGET game POST_BUILD
  202. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  203. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release/portmidi.dll" # <--this is in-file
  204. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  205. add_custom_command(TARGET game POST_BUILD
  206. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  207. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/bin/Release/websockets.dll" # <--this is in-file
  208. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  209. add_custom_command(TARGET game POST_BUILD
  210. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  211. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" # <--this is in-file
  212. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  213. add_custom_command(TARGET game POST_BUILD
  214. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  215. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" # <--this is in-file
  216. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  217. add_custom_command(TARGET server POST_BUILD
  218. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  219. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/bin/Release/websockets.dll" # <--this is in-file
  220. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  221. add_custom_command(TARGET server POST_BUILD
  222. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  223. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" # <--this is in-file
  224. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  225. add_custom_command(TARGET server POST_BUILD
  226. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  227. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" # <--this is in-file
  228. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  229. endif ()