Skip to content

location

Jason Perkins edited this page Apr 14, 2015 · 8 revisions

The location function sets the destination directory for a generated solution or project file.

location ("path")

By default, solution and project files are generated into the same directory as the script that defines them. The location function allows you to change this location.

Note that unlike other values, location does not automatically propagate to the contained projects. Projects will use their default location unless explicitly overridden.

Applies To

Solutions and projects.

Parameters

path is the directory where the generated files should be stored, specified relative to the currently executing script file.

Examples

Set the destination directory for a solution. Setting the location for a project works the same way.

solution "MySolution"
  location "../build"

If you plan to build with multiple tools from the same source tree you might want to split up the project files by toolset. The _ACTION global variable contains the current toolset identifier, as specified on the command line. Note that Lua syntax requires parenthesis around the function parameters in this case.

location ("../build/" .. _ACTION)
Clone this wiki locally