cmake_minimum_required(VERSION 3.10)
# I'm guessing your project name from the path,
# change "VoxelEngine" if it's wrong.
project(VoxelEngine)

# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

file(COPY objs/ DESTINATION objs/)
file(COPY shaders/ DESTINATION shaders/)

# --- Define the Executable ---
# Make sure to use your project name here.
add_executable(VoxelEngine
    src/main.cpp
    src/glad.c
    src/Shader.h
    src/Object3D.h
    src/Object3D.cpp
    src/Camera.h
    src/World.h
    src/World.cpp
    src/Mesh.h
    src/Mesh.cpp
    src/Chunk.h
    src/Chunk.cpp
)

# --- Configure GLAD (from your src/ and include/ folders) ---
# This adds your local "include" folder (for glad.h)
target_include_directories(VoxelEngine PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)

# --- Manually Configure GLFW ---

# 1. Tell CMake where to find the GLFW header files (glfw3.h)
target_include_directories(VoxelEngine PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/vendor/include
)

# 2. Tell CMake to link against the specific GLFW .lib file
target_link_libraries(VoxelEngine PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/vendor/lib-vc2022/glfw3.lib
)
