cmake_minimum_required(VERSION 3.25)

project(work-calendar VERSION 0.1 LANGUAGES CXX C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)

# Dear ImGui
add_library(imgui STATIC
    libs/imgui/imgui.cpp
    libs/imgui/imgui_draw.cpp
    libs/imgui/imgui_demo.cpp
    libs/imgui/imgui_tables.cpp
    libs/imgui/imgui_widgets.cpp
    $<$<PLATFORM_ID:Windows>:
        libs/imgui/backends/imgui_impl_win32.cpp
        libs/imgui/backends/imgui_impl_dx11.cpp
    >
    $<$<PLATFORM_ID:Linux>:
        libs/imgui/backends/imgui_impl_glfw.cpp
        libs/imgui/backends/imgui_impl_vulkan.cpp
    >
)

target_include_directories(imgui PUBLIC
    libs/imgui
    libs/imgui/backends
)

add_executable(work-calendar
    $<$<PLATFORM_ID:Windows>:src/main_win32.cpp>
    $<$<PLATFORM_ID:Linux>:src/main_linux.cpp>
)

target_link_libraries(work-calendar
    PRIVATE
        imgui
        $<$<PLATFORM_ID:Windows>:D3D11>
        $<$<PLATFORM_ID:Linux>:
            vulkan
            glfw
        >
)