- cmake_minimum_required(VERSION 3.20)
-
- # Set your project name here
- project(izanagi C)
-
- set(CMAKE_C_STANDARD 11)
-
- include_directories("${PROJECT_SOURCE_DIR}/dependencies/SDL2/include")
-
- if (WIN32)
- if (CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(PROJECT_ARCH x64)
- else ()
- set(PROJECT_ARCH x86)
- endif ()
- endif ()
-
- link_directories("${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}")
- add_executable(izanagi src/packages/game/main.c)
- target_link_libraries(izanagi SDL2main SDL2)
-
- if (WIN32)
- add_custom_command(TARGET izanagi POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
- "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
- $<TARGET_FILE_DIR:izanagi>) # <--this is out-file path
- endif ()
|