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 7.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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)
  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/protocol_lws_minimal.c src/packages/server/IZ_app.c src/packages/server/IZ_app.h)
  152. target_link_libraries(
  153. server
  154. SDL2main
  155. SDL2
  156. libcrypto
  157. libssl
  158. websockets
  159. )
  160. if (WIN32)
  161. add_custom_command(TARGET game POST_BUILD
  162. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  163. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  164. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  165. add_custom_command(TARGET game POST_BUILD
  166. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  167. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release/portmidi.dll" # <--this is in-file
  168. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  169. add_custom_command(TARGET game POST_BUILD
  170. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  171. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/bin/Release/websockets.dll" # <--this is in-file
  172. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  173. add_custom_command(TARGET game POST_BUILD
  174. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  175. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" # <--this is in-file
  176. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  177. add_custom_command(TARGET game POST_BUILD
  178. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  179. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" # <--this is in-file
  180. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  181. add_custom_command(TARGET server POST_BUILD
  182. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  183. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/bin/Release/websockets.dll" # <--this is in-file
  184. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  185. add_custom_command(TARGET server POST_BUILD
  186. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  187. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" # <--this is in-file
  188. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  189. add_custom_command(TARGET server POST_BUILD
  190. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  191. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" # <--this is in-file
  192. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  193. endif ()