# Define the minimum CMAKE version required:
cmake_minimum_required(VERSION 3.20)

# Define the project:
project(DoFFramework C CXX)

# Set C++ stardard:
set(CMAKE_CXX_STANDARD 11)

# Enable automatic include of generated files (like paths.h):
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Include IMGUI (which already includes GLFW):
add_subdirectory(lib/imgui-1.88/)

# Include GLAD for OpenGL 3.3 Core functionalities:
add_subdirectory(lib/glad)

# Define all header files we want to compile:
set(HEADERS 
    # Rendering classes
    src/Mesh.h
    src/Shader.h
    src/Texture2D.h
    src/TextureFBO.h

    # Math classes
    src/math/Vec4f.h
    src/math/Mat4f.h

    # Primitives
    src/primitives/Triangle.h
    src/primitives/Vertex.h
    src/primitives/TexCoord.h
    src/primitives/Barycentric.h

    # Actor and world
    src/game/World.h
	src/game/Suzanne.h
)

# Define all source files we want to compile:
set(SOURCES 
    src/main.cpp

    # Rendering classes
    src/Mesh.cpp
    src/Shader.cpp
    src/Texture2D.cpp
    src/TextureFBO.cpp

    # Math classes
    src/math/Vec4f.cpp
    src/math/Mat4f.cpp

    # Actor and world
    src/game/World.cpp
	src/game/Suzanne.cpp
)

# Define shader & resources which should be listed in IDE:
set(RESOURCES

    shader/world.vert
    shader/world.frag
    shader/DoF.vert
    shader/DoF.frag
	shader/suzanne.vert
    shader/suzanne.frag
)

# Allow to include files directly in this paths
# (without the need to specify folders):
include_directories(src src/primitives src/math lib/stb_image lib/tiny_obj_loader)

# Define executables with source files and resources:
add_executable(DoFFramework ${SOURCES} ${HEADERS} ${RESOURCES})

# IMGUI specific compile definition:
target_compile_definitions(DoFFramework PUBLIC -DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}")

# Define the libraries to link against:
target_link_libraries(DoFFramework PUBLIC imgui glad)

