Starter project for SDL2.
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.

28 lines
819 B

  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("${PROJECT_SOURCE_DIR}/dependencies/SDL2/include")
  6. if (WIN32)
  7. if (CMAKE_SIZEOF_VOID_P EQUAL 8)
  8. set(PROJECT_ARCH x64)
  9. else ()
  10. set(PROJECT_ARCH x86)
  11. endif ()
  12. endif ()
  13. link_directories("${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}")
  14. add_executable(izanagi src/packages/game/main.c)
  15. target_link_libraries(izanagi SDL2main SDL2)
  16. if (WIN32)
  17. add_custom_command(TARGET izanagi POST_BUILD
  18. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  19. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  20. $<TARGET_FILE_DIR:izanagi>) # <--this is out-file path
  21. endif ()