include - premake/premake-4.x GitHub Wiki
Home > [Scripting Reference](Scripting Reference) > include
include
The include function looks for a file named premake4.lua in a specified directory, and includes it in the current script.
#!lua
include "directory"
This is equivalent to:
#!lua
dofile "directory/premake4.lua"
This allows you to specify each project in its own premake4.lua file, and then easily include them into a solution, or multiple solutions.
Parameters
directory is the path to the included directory, relative to the currently executing script file. The directory must contain a premake4.lua file, or an error will occur. If you wish to call a file other than premake4.lua, use the dofile function instead.
Return Value
Any values returned by the included script are passed through to the caller.
Examples
#!lua
-- runs "src/MyApplication/premake4.lua"
include "src/MyApplication"
-- runs "src/MyLibrary/premake4.lua"
include "src/MyLibrary"