cmake_minimum_required(VERSION 3.28)
project(Prog3B)
set(EXECUTABLE_NAME Prog3B)

# Generate compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20)


set(SRC_FILES
        src/main.cpp
        src/gamecube.cpp
)
add_executable(${EXECUTABLE_NAME} ${SRC_FILES})


target_include_directories(${EXECUTABLE_NAME} PRIVATE
        ${CMAKE_CURRENT_LIST_DIR}/includes
        ${CMAKE_CURRENT_LIST_DIR}/raylib
)


if(WIN32)

    message(STATUS "Configuring for Windows")
    target_link_libraries(${EXECUTABLE_NAME} PRIVATE
            ${CMAKE_CURRENT_LIST_DIR}/windows/libgamematrix.a
            ${CMAKE_CURRENT_LIST_DIR}/windows/libraylib.a
            opengl32 gdi32 winmm
    )
elseif(APPLE)

    message(STATUS "Configuring for MacOS")

    target_link_libraries(${EXECUTABLE_NAME} PRIVATE
            ${CMAKE_CURRENT_LIST_DIR}/mac_x86/libgamematrix.a
            ${CMAKE_CURRENT_LIST_DIR}/mac_x86/libraylib.a
            "-framework IOKit"
            "-framework Cocoa"
            "-framework OpenGL"
    )
else()
    # --- Linux ---
    message(STATUS "Configuring for Linux")
    target_link_libraries(${EXECUTABLE_NAME} PRIVATE
            ${CMAKE_CURRENT_LIST_DIR}/linux/libgamematrix.a
            ${CMAKE_CURRENT_LIST_DIR}/linux/libraylib.a
            GL X11 m
    )
endif()