
set(target frame)

configure_file (
  "${PROJECT_SOURCE_DIR}/frame/src/BuildConfig.h.in"
  "${PROJECT_SOURCE_DIR}/frame/src/BuildConfig.h"
)

set(src 
    src/main.cpp
    
    src/Config.hpp
    src/Config.cpp   

    src/Size.hpp
    src/Vector.hpp
    src/Rect.hpp

    src/Image.hpp
    src/Image.cpp

    src/ScreenManager.hpp
    src/ScreenManager.cpp
    
    src/ServiceLocator.hpp
    src/ServiceLocator.cpp

    src/display/IDisplay.hpp
    src/display/Display.hpp
    src/display/Display.cpp
    
    src/render/RenderTarget.hpp
    src/render/RenderTarget.cpp
    
    src/font/Font.hpp
    src/font/Font.cpp
    src/font/Glyph.hpp
    src/font/Glyph.cpp
    src/font/FontRegistry.hpp
    src/font/FontRegistry.cpp


    src/widgets/Widget.hpp
    src/widgets/Widget.cpp
    src/widgets/ContainerWidget.hpp
    src/widgets/ContainerWidget.cpp
    src/widgets/WidgetRegistry.hpp
    src/widgets/WidgetRegistry.cpp
    src/widgets/clock/Digital.hpp
    src/widgets/clock/Digital.cpp
    src/widgets/clock/Analog.hpp
    src/widgets/clock/Analog.cpp
    src/widgets/clock/Date.hpp
    src/widgets/clock/Date.cpp

)

if (BUILD_EPD)
    set(src ${src}
        src/display/EPD_7in5_V2.hpp 
        src/display/EPD_7in5_V2.cpp 
    )
endif (BUILD_EPD)

if (BUILD_VIRTUAL_DISPLAY)
    set(src ${src}
        src/display/VirtualDisplay.hpp 
        src/display/VirtualDisplay.cpp 
    )
endif (BUILD_VIRTUAL_DISPLAY)

add_executable(${target} ${src})
target_link_libraries(${target} PRIVATE 
    fmt::fmt
    nlohmann_json::nlohmann_json
)

if (BUILD_EPD)
    target_link_libraries(${target} PRIVATE 
        waveshare
    )
endif (BUILD_EPD)

if (BUILD_VIRTUAL_DISPLAY)
    target_link_libraries(${target} PRIVATE 
        sfml-system 
        sfml-window 
        sfml-graphics
        fmt::fmt
        nlohmann_json::nlohmann_json
    )
endif(BUILD_VIRTUAL_DISPLAY)