cmake_minimum_required(VERSION 3.25)
project(LotoStatek)

set(CMAKE_CXX_STANDARD 17)

add_executable(LotoStatek main.cpp
        headers/Actor.h
        headers/Plansza.h
        sources/Actor.cpp
        sources/Plansza.cpp
        sources/Player.cpp
        headers/Player.h
        headers/Bullet.h
        sources/Bullet.cpp
        headers/Background.h
        sources/Background.cpp
        headers/AudioManager.h
        sources/AudioManager.cpp
        sources/Bullet.cpp
        headers/Meteor.h
        sources/Meteor.cpp
        headers/RandomNumberGenerator.h)

if(WIN32)
    set(SFML_ROOT "${CMAKE_SOURCE_DIR}/SFML")
#    set(SFML_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/SFML/include")
    file(GLOB BINARY_DEP_DLLS "${SFML_INCLUDE_DIR}/../bin/*.dll")
    file(COPY ${BINARY_DEP_DLLS} DESTINATION ${CMAKE_BINARY_DIR})
    include_directories("${CMAKE_SOURCE_DIR}/SFML/bin" "${CMAKE_SOURCE_DIR}/SFML/include" "${CMAKE_SOURCE_DIR}/SFML/lib/cmake/SFML") # dodane
    set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules") # dodane
    find_package(SFML 2.5.1 COMPONENTS graphics window system audio REQUIRED)
    if(SFML_FOUND)
        include_directories(${SFML_INCLUDE_DIR})
        target_link_libraries(LotoStatek ${SFML_LIBRARIES})
    endif()
elseif(APPLE)
    find_package(SFML 2.5.1 COMPONENTS graphics window system REQUIRED)
    target_link_libraries(LotoStatek sfml-graphics sfml-window sfml-audio sfml-system)
elseif(LINUX)
    find_package(SFML 2.5.1 COMPONENTS graphics window system REQUIRED)
    target_link_libraries(LotoStatek sfml-graphics sfml-window sfml-audio sfml-system)
endif()