path.getabsolute

The path.getabsolute function converts a relative path an absolute path.

p = path.getabsolute("path")

Parameters

path is the relative path to be converted. It does need to actually exist on the file system.

Return Value

A new absolute path, calculated from the current working directory.

The current working directory ( as returned by os.getcwd() ) is
the directory of the premake4.lua file.
If you includes sub premake4.lua file, this will become the new working directory

eg:

    -- main top/premake4.lua in top dir
    solution "test"
    include "subfolder"
    os.getcwd()  -- return top
    path.getabsolute("path") -- return /top/path

and in subfolder

    -- in top/subfolder/premake4.lua 
    project "exe1"
    os.getcwd()  -- return top/subfolder
    path.getabsolute("path") -- return /top/subfolder/path

You can use this to get a path relative to the top folder:

sub getAbsoluteFromSolution(p)
    local sol = solution() 
    return path.getabsolute( path.join(sol.basedir, p))
end