cmake_minimum_required(VERSION 3.31)
project(Dicewars_Siedler)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(OpenGL REQUIRED)

add_subdirectory(lib/glfw)

add_library(glad STATIC
        lib/glad/src/glad.c
)
target_include_directories(glad PUBLIC
    lib/glad/include
)

add_executable(Dicewars_Siedler src/main.cpp
        src/engine/core/Window.cpp
        src/engine/core/Window.h
        src/engine/platform/glfw/GLFWWindow.cpp
        src/engine/platform/glfw/GLFWWindow.h
        src/engine/core/Application.cpp
        src/engine/core/Application.h
        src/game/DicewarsApp.cpp
        src/game/DicewarsApp.h
        src/engine/renderer/model/RawModel.cpp
        src/engine/renderer/model/RawModel.h
        src/engine/renderer/loader/Loader.cpp
        src/engine/renderer/loader/Loader.h
        src/engine/renderer/Renderer.cpp
        src/engine/renderer/Renderer.h
        src/engine/layer/Layer.cpp
        src/engine/layer/Layer.h
        src/game/GameLayer.cpp
        src/game/GameLayer.h
        src/engine/renderer/shaders/ShaderProgram.cpp
        src/engine/renderer/shaders/ShaderProgram.h
        src/engine/renderer/shaders/StaticShader.cpp
        src/engine/renderer/shaders/StaticShader.h
        src/engine/renderer/loader/Texture2D.h
        src/engine/renderer/loader/TextureLoader.cpp
        src/engine/renderer/loader/TextureLoader.h
        src/engine/renderer/textures/ModelTexture.cpp
        src/engine/renderer/textures/ModelTexture.h
        src/engine/renderer/model/TexturedModel.cpp
        src/engine/renderer/model/TexturedModel.h
        src/engine/toolbox/MathUtils.h
        src/engine/layer/entities/Entity.cpp
        src/engine/layer/entities/Entity.h
        src/engine/layer/entities/Camera.cpp
        src/engine/layer/entities/Camera.h
        src/engine/platform/glfw/InputManager.cpp
        src/engine/platform/glfw/InputManager.h
        src/engine/renderer/loader/OBJLoader.cpp
        src/engine/renderer/loader/OBJLoader.h
        src/engine/layer/entities/Light.cpp
        src/engine/layer/entities/Light.h
        src/engine/platform/glfw/MousePicker.cpp
        src/engine/platform/glfw/MousePicker.h
        src/game/hexWorld/HexTile.h
        src/game/hexWorld/Map.cpp
        src/game/hexWorld/Map.h
        src/game/hexWorld/MapGenerator.cpp
        src/game/hexWorld/MapGenerator.h
        src/game/hexWorld/HexModelFactory.cpp
        src/game/hexWorld/HexModelFactory.h
        src/engine/renderer/MasterRenderer.cpp
        src/engine/renderer/MasterRenderer.h
        src/engine/renderer/TerrainRenderer.cpp
        src/engine/renderer/TerrainRenderer.h
        src/engine/renderer/shaders/TerrainShader.cpp
        src/engine/renderer/shaders/TerrainShader.h
)

target_include_directories(Dicewars_Siedler PRIVATE
    lib/glfw/include
        lib/glm
        lib/stb_image
        lib/tinyobjloader
)

target_link_libraries(Dicewars_Siedler
        PRIVATE
            glfw
            glad
            OpenGL::GL
)