cmake_minimum_required(VERSION 3.10)
project(tank_battles_on_the_scrap_paper
    VERSION 1.0
    LANGUAGES CXX
)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(SDL2_ttf REQUIRED)

set(SOURCES
    tank_battles_on_the_scrap_paper/main.cpp
    tank_battles_on_the_scrap_paper/src/AssetManager.cpp
    tank_battles_on_the_scrap_paper/src/Renderer.cpp
    tank_battles_on_the_scrap_paper/src/Map.cpp
    tank_battles_on_the_scrap_paper/src/Bullet.cpp
    tank_battles_on_the_scrap_paper/src/Tank.cpp
    tank_battles_on_the_scrap_paper/src/Game.cpp
)

set(HEADERS
    tank_battles_on_the_scrap_paper/data_config.h
    tank_battles_on_the_scrap_paper/src/AssetManager.h
    tank_battles_on_the_scrap_paper/src/Renderer.h
    tank_battles_on_the_scrap_paper/src/Map.h
    tank_battles_on_the_scrap_paper/src/Bullet.h
    tank_battles_on_the_scrap_paper/src/Tank.h
    tank_battles_on_the_scrap_paper/src/Game.h
    tank_battles_on_the_scrap_paper/src/UI.h
)

add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})

target_link_libraries(${PROJECT_NAME} PRIVATE
    SDL2::SDL2
    SDL2_image::SDL2_image
    SDL2_mixer::SDL2_mixer
    SDL2_ttf::SDL2_ttf
)

target_include_directories(${PROJECT_NAME} PRIVATE
    tank_battles_on_the_scrap_paper
)

file(COPY
    tank_battles_on_the_scrap_paper/images/
    DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/images/
)

file(COPY
    tank_battles_on_the_scrap_paper/music/
    DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/music/
)
