cmake_minimum_required(VERSION 3.0.0)
project(Tic-Tac-Toe VERSION 0.1.0)

find_package(SDL2 CONFIG REQUIRED)
find_package(SDL2_image CONFIG REQUIRED)
find_package(sdl2-gfx CONFIG REQUIRED)
    
add_executable(Tic-Tac-Toe main.cpp App.cpp App.hh Board.cpp Board.hh Typedef.hh)

target_link_libraries(Tic-Tac-Toe
    PRIVATE
    $<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
    $<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
)
target_link_libraries(Tic-Tac-Toe 
    PRIVATE 
    $<IF:$<TARGET_EXISTS:SDL2_image::SDL2_image>,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static>
)
target_link_libraries(Tic-Tac-Toe PRIVATE SDL2::SDL2_gfx)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
