Starter project for SDL2.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

CMakeLists.txt 1.1 KiB

1234567891011121314151617181920212223242526272829303132333435
  1. cmake_minimum_required(VERSION 3.20)
  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. )
  9. if (WIN32)
  10. if (CMAKE_SIZEOF_VOID_P EQUAL 8)
  11. set(PROJECT_ARCH x64)
  12. else ()
  13. set(PROJECT_ARCH x86)
  14. endif ()
  15. endif ()
  16. link_directories("${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}")
  17. add_executable(
  18. izanagi
  19. dependencies/minIni/dev/minIni.h
  20. dependencies/minIni/dev/minIni.c
  21. src/packages/game/main.c
  22. src/packages/game/config/IZ_config.h src/packages/game/config/IZ_config.c src/packages/game/IZ_common.h src/packages/game/IZ_action.h src/packages/game/IZ_app.c src/packages/game/IZ_app.h)
  23. target_link_libraries(izanagi SDL2main SDL2)
  24. if (WIN32)
  25. add_custom_command(TARGET izanagi POST_BUILD
  26. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  27. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  28. $<TARGET_FILE_DIR:izanagi>) # <--this is out-file path
  29. endif ()