2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

CMakeLists.txt 2.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. )
  11. if (WIN32)
  12. if (CMAKE_SIZEOF_VOID_P EQUAL 8)
  13. set(PROJECT_ARCH x64)
  14. else ()
  15. set(PROJECT_ARCH x86)
  16. endif ()
  17. endif ()
  18. link_directories(
  19. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}"
  20. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release"
  21. )
  22. add_executable(
  23. game
  24. dependencies/minIni/dev/minIni.h
  25. dependencies/minIni/dev/minIni.c
  26. src/packages/game/output/IZ_video.h
  27. src/packages/game/output/IZ_video.c
  28. src/packages/game/IZ_common.h
  29. src/packages/game/IZ_action.h
  30. src/packages/game/IZ_app.h
  31. src/packages/game/IZ_app.c
  32. src/packages/game/main.c
  33. src/packages/game/input/IZ_joystick.c
  34. src/packages/game/input/IZ_joystick.h
  35. src/packages/game/input/IZ_keyboard.c
  36. src/packages/game/input/IZ_keyboard.h
  37. src/packages/game/IZ_config.c
  38. src/packages/game/IZ_config.h
  39. )
  40. target_link_libraries(
  41. game
  42. SDL2main
  43. SDL2
  44. )
  45. add_executable(
  46. game-test-output
  47. dependencies/bdd-for-c/bdd-for-c.h
  48. src/packages/test/IZ_mock.h
  49. src/packages/test/IZ_test.h
  50. __mocks__/minIni.mock.h
  51. __mocks__/SDL_keyboard.mock.h
  52. src/packages/game/IZ_config.h
  53. src/packages/game/__mocks__/IZ_config.mock.h
  54. src/packages/game/output/IZ_video.h
  55. src/packages/game/output/IZ_video.c
  56. src/packages/game/output/IZ_video.test.c
  57. )
  58. add_executable(
  59. game-test-input
  60. dependencies/bdd-for-c/bdd-for-c.h
  61. src/packages/test/IZ_mock.h
  62. src/packages/test/IZ_test.h
  63. __mocks__/minIni.mock.h
  64. __mocks__/SDL_keyboard.mock.h
  65. src/packages/game/IZ_config.h
  66. src/packages/game/__mocks__/IZ_config.mock.h
  67. src/packages/game/input/IZ_keyboard.h
  68. src/packages/game/input/IZ_keyboard.c
  69. src/packages/game/input/IZ_keyboard.test.c
  70. # src/packages/game/input/IZ_joystick.h
  71. # src/packages/game/input/IZ_joystick.c
  72. )
  73. if (WIN32)
  74. add_custom_command(TARGET game POST_BUILD
  75. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  76. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  77. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  78. endif ()