local m = {}

local scriptdir = path.getabsolute(path.getdirectory(_SCRIPT))

local sfml = require("path/to/premake-scripts/build-sfml")
local imguisfml = require("path/to/premake-scripts/build-imgui-sfml")
local imgui = require("path/to/premake-scripts/build-imgui")

function m.generateproject(bindir, intdir)
project "example"
    language "C++"
    cppdialect "C++20"
    systemversion "latest"
    kind "WindowedApp"
    targetname "example"
    targetdir (bindir)
    objdir (intdir)
    debug(scriptdir) -- assuming scriptdir has your assets, config files, etc

    -- link order matters on GCC/Clang
    imgui.link()
    imguisfml.link()
    sfml.link()

    -- use path.join() and scriptdir to make
    -- the path relative to the location of the script
    -- otherwise it will be relative to the script that calls
    -- generateproject()
    includedirs
    {
        path.join(scriptdir, "src"),
        path.join(scriptdir, "include"),
    }

    files
    {
        path.join(scriptdir, "src/**.cpp"),
        path.join(scriptdir, "include/**.h"),
        path.join(scriptdir, "include/**.hpp"),
    }

    --windows specific settings--
    filter{"system:windows"}
        defines {"PLATFORM_WINDOWS"}

    filter {"system:windows", "configurations:debug"}
        defines{"_DEBUG", "_CONSOLE"}

    filter {"system:windows", "configurations:release"}
        defines{"NDEBUG"}

    --linux specific settings--
    filter {"system:linux"}
        defines {"PLATFORM_LINUX"}

end

return m
