I have a single line batch file that creates the solution by calling Premake4.exe with a lua-script file argument.
//CreateSolution.bat
..\..\premake\Premake4 --file=ScriptFile.lua --platform=x32 vs2008
and the associated script file contains the information for the solution as well as the project.
//ScriptFile.lua
solution "MySolution"
configurations { "Debug" }
project "MyProject"
kind "ConsoleApp"
language "C++"
local sampleSDK = 'C:/Users/Alex/Documents/sampleSDK'
files {"**.h", "**.cpp" }
includedirs { "include" }
links { sampleSDK .. '/lib/sample' }
configuration "Debug"
flags { "Symbols" }
defines { "WIN32", "_DEBUG" }
This is the basic structure if you are only creating one project for this solution and all the files are located in immediate subfolders. Alternatively you could create a Solution lua script file, and corresponding Project scripts that would look something like this:
//SolutionFile.lua
solution "MySolution"
configurations { "Debug" }
dofile('./Project0/Project0-premake.lua')
dofile('./Project1/Project1-premake.lua')
//Project0-premake.lua
project "MyProject0"
kind "ConsoleApp"
language "C++"
.
.
.
In this way you can continue to use **.h and **.cpp because all the files are in their corresponding folders. Otherwise you would have to specify which files to include in each project, which is not very practical for anything larger than a couple files.
This is just how I'm currently doing things with my current setup, other minor tweaking for your particular setup should be evident.
No comments:
Post a Comment