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
)

find_package(Freetype REQUIRED)
include_directories(${FREETYPE_INCLUDE_DIRS})


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/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
        src/engine/renderer/model/AssetManager.cpp
        src/engine/renderer/model/AssetManager.h
        src/game/hexWorld/tileGenerator/HexTileGeneratorStrategy.cpp
        src/game/hexWorld/tileGenerator/HexTileGeneratorStrategy.h
        src/game/hexWorld/tileGenerator/ForestTileGenerator.cpp
        src/game/hexWorld/tileGenerator/ForestTileGenerator.h
        src/engine/toolbox/Random.cpp
        src/engine/toolbox/Random.h
        src/engine/core/ECS/Component.cpp
        src/engine/core/ECS/Component.h
        src/engine/core/ECS/TransformComponent.cpp
        src/engine/core/ECS/TransformComponent.h
        src/engine/core/ECS/ModelComponent.cpp
        src/engine/core/ECS/ModelComponent.h
        src/engine/core/ECS/EntityManager.cpp
        src/engine/core/ECS/EntityManager.h
        src/engine/core/ECS/RenderSystem.cpp
        src/engine/core/ECS/RenderSystem.h
        src/engine/core/ECS/TileRenderComponent.cpp
        src/engine/core/ECS/TileRenderComponent.h
        src/game/hexWorld/ecs/components/TileGameplayComponent.cpp
        src/game/hexWorld/ecs/components/TileGameplayComponent.h
        src/game/hexWorld/ecs/components/MapEntityComponent.h
        src/engine/renderer/components/TerrainRenderingData.h
        src/game/hexWorld/RessourceType.h
        src/game/hexWorld/ecs/systems/TileHighlightSystem.cpp
        src/game/hexWorld/ecs/systems/TileHighlightSystem.h
        src/game/hexWorld/ecs/components/BuildingComponent.cpp
        src/game/hexWorld/ecs/components/BuildingComponent.h
        src/game/hexWorld/ecs/systems/BuildingPlacementSystem.cpp
        src/game/hexWorld/ecs/systems/BuildingPlacementSystem.h
        src/game/GameMode.cpp
        src/game/GameMode.h
        src/game/PlayerInventory.cpp
        src/game/PlayerInventory.h
        src/game/player/Player.cpp
        src/game/player/Player.h
        src/game/hexWorld/ecs/components/OwnerComponent.cpp
        src/game/hexWorld/ecs/components/OwnerComponent.h
        src/engine/renderer/model/GUITexture.cpp
        src/engine/renderer/model/GUITexture.h
        src/engine/renderer/GUIRenderer.cpp
        src/engine/renderer/GUIRenderer.h
        src/game/UILayer.cpp
        src/game/UILayer.h
        src/engine/renderer/shaders/GUIShader.cpp
        src/engine/renderer/shaders/GUIShader.h
        src/engine/core/gui/uiComponent/UiComponent.cpp
        src/engine/core/gui/uiComponent/UiComponent.h
        src/engine/core/gui/uiComponent/Dimensions.h
        src/engine/core/gui/uiComponent/layout/UiPositioner.cpp
        src/engine/core/gui/uiComponent/layout/UiPositioner.h
        src/engine/core/gui/uiMain/UiContainer.cpp
        src/engine/core/gui/uiMain/UiContainer.h
        src/engine/core/gui/uiComponent/UiImage.cpp
        src/engine/core/gui/uiComponent/UiImage.h
        src/engine/core/gui/uiComponent/UiText.cpp
        src/engine/core/gui/uiComponent/UiText.h
        src/engine/core/gui/text/Font.cpp
        src/engine/core/gui/text/Font.h
        src/engine/core/gui/uiComponent/UiRenderBundle.cpp
        src/engine/core/gui/uiComponent/UiRenderBundle.h
        src/engine/renderer/shaders/TextShader.cpp
        src/engine/renderer/shaders/TextShader.h
        src/engine/renderer/TextRenderer.cpp
        src/engine/renderer/TextRenderer.h
        src/engine/renderer/model/TextQuadModel.cpp
        src/engine/renderer/model/TextQuadModel.h
        src/engine/core/gui/uiComponent/layout/LayoutStyle.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
        ${FREETYPE_LIBRARIES}
)