cmake_minimum_required(VERSION 3.28)
project(Prog3B)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(EXECUTABLE_NAME Prog3B)

# Quell-Dateien direkt im Projektordner
set(SRC_FILES
    ${CMAKE_CURRENT_LIST_DIR}/main.cpp
    ${CMAKE_CURRENT_LIST_DIR}/gamecube.cpp
)

# Include-Pfade
set(INCLUDE_DIRS
    ${CMAKE_CURRENT_LIST_DIR}         
    ${CMAKE_CURRENT_LIST_DIR}/raylib  
    ${CMAKE_CURRENT_LIST_DIR}/mac_arm 
)

# Executable erstellen
add_executable(${EXECUTABLE_NAME} ${SRC_FILES})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${INCLUDE_DIRS})

# Libraries linken
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
    ${CMAKE_CURRENT_LIST_DIR}/mac_arm/libgamematrix.a
    ${CMAKE_CURRENT_LIST_DIR}/mac_arm/libraylib.a
)

# Mac-spezifische Frameworks
if(APPLE)
    target_link_libraries(${EXECUTABLE_NAME} PRIVATE
        "-framework IOKit"
        "-framework Cocoa"
        "-framework OpenGL"
    )
endif()