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.

CMakeLists.txt 7.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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. src/packages/game/network/IZ_wsclient.c src/packages/game/network/IZ_wsclient.h src/packages/game/log/IZ_log.c src/packages/game/log/IZ_log.h src/packages/game/network/IZ_network.h)
  68. target_link_libraries(
  69. game
  70. SDL2main
  71. SDL2
  72. portmidi
  73. libcrypto
  74. libssl
  75. websockets
  76. )
  77. add_executable(
  78. game-test-geometry
  79. dependencies/bdd-for-c/bdd-for-c.h
  80. src/packages/test/IZ_mock.h
  81. src/packages/test/IZ_test.h
  82. src/packages/game/geometry/IZ_point2d.h
  83. src/packages/game/geometry/IZ_point2d.c
  84. src/packages/game/geometry/IZ_rect.h
  85. src/packages/game/geometry/IZ_rect.c
  86. src/packages/game/geometry/IZ_vector2d.h
  87. src/packages/game/geometry/IZ_vector2d.c
  88. src/packages/game/geometry/geometry.test.c
  89. )
  90. add_executable(
  91. game-test-input
  92. dependencies/bdd-for-c/bdd-for-c.h
  93. src/packages/test/IZ_mock.h
  94. src/packages/test/IZ_test.h
  95. __mocks__/minIni.mock.h
  96. __mocks__/SDL_keyboard.mock.h
  97. __mocks__/SDL_events.mock.h
  98. __mocks__/SDL_joystick.mock.h
  99. __mocks__/SDL_stdinc.mock.h
  100. __mocks__/portmidi.mock.h
  101. src/packages/game/IZ_config.h
  102. src/packages/game/input/IZ_keyboard.h
  103. src/packages/game/input/IZ_keyboard.c
  104. src/packages/game/input/IZ_joystick.h
  105. src/packages/game/input/IZ_joystick.c
  106. src/packages/game/input/IZ_midi.h
  107. src/packages/game/input/IZ_midi.c
  108. src/packages/game/input/input.test.c
  109. )
  110. add_executable(
  111. game-test-output
  112. dependencies/bdd-for-c/bdd-for-c.h
  113. src/packages/test/IZ_mock.h
  114. src/packages/test/IZ_test.h
  115. __mocks__/minIni.mock.h
  116. __mocks__/SDL_stdinc.mock.h
  117. __mocks__/SDL_render.mock.h
  118. src/packages/game/IZ_config.h
  119. src/packages/game/output/IZ_video.h
  120. src/packages/game/output/IZ_video.c
  121. src/packages/game/output/output.test.c
  122. )
  123. add_executable(
  124. game-test-memory
  125. dependencies/bdd-for-c/bdd-for-c.h
  126. src/packages/test/IZ_mock.h
  127. src/packages/test/IZ_test.h
  128. src/packages/game/memory/IZ_pool.h
  129. src/packages/game/memory/IZ_pool.c
  130. src/packages/game/memory/memory.test.c
  131. src/packages/game/data/IZ_list.c
  132. src/packages/game/data/IZ_list.h
  133. )
  134. add_executable(
  135. game-test-data
  136. dependencies/bdd-for-c/bdd-for-c.h
  137. src/packages/test/IZ_mock.h
  138. src/packages/test/IZ_test.h
  139. src/packages/game/data/IZ_list.h
  140. src/packages/game/data/IZ_list.c
  141. src/packages/game/data/data.test.c
  142. )
  143. add_executable(
  144. server
  145. dependencies/minIni/dev/minIni.h
  146. dependencies/minIni/dev/minIni.c
  147. src/packages/server/IZ_common.h
  148. src/packages/server/log/IZ_log.h
  149. src/packages/server/log/IZ_log.c
  150. src/packages/server/main.c
  151. src/packages/server/network/IZ_wsserver.c src/packages/server/IZ_app.c src/packages/server/IZ_app.h src/packages/server/network/IZ_wsserver.h
  152. src/packages/server/network/IZ_network.h
  153. )
  154. target_link_libraries(
  155. server
  156. SDL2main
  157. SDL2
  158. libcrypto
  159. libssl
  160. websockets
  161. )
  162. if (WIN32)
  163. add_custom_command(TARGET game POST_BUILD
  164. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  165. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  166. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  167. add_custom_command(TARGET game POST_BUILD
  168. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  169. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release/portmidi.dll" # <--this is in-file
  170. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  171. add_custom_command(TARGET game POST_BUILD
  172. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  173. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/bin/Release/websockets.dll" # <--this is in-file
  174. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  175. add_custom_command(TARGET game POST_BUILD
  176. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  177. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" # <--this is in-file
  178. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  179. add_custom_command(TARGET game POST_BUILD
  180. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  181. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" # <--this is in-file
  182. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  183. add_custom_command(TARGET server POST_BUILD
  184. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  185. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/bin/Release/websockets.dll" # <--this is in-file
  186. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  187. add_custom_command(TARGET server POST_BUILD
  188. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  189. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" # <--this is in-file
  190. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  191. add_custom_command(TARGET server POST_BUILD
  192. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  193. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" # <--this is in-file
  194. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  195. endif ()