1

I use premake5 version 5.0.0-alpha11 for multi projects. Each project is a independent with each others. Currently, my premake5.lua as below

-- The windowed app

project "1.DepthTest"

kind "ConsoleApp"

filter { "system:Windows" }
files "Projects/1.DepthTest/**"

filter { "system:windows" }
    links { "OpenGL32" }

filter { "system:not windows" }
    links { "GL" }

project "2.StencilTest"

kind "ConsoleApp"

filter { "system:Windows" }
files "Projects/2.StencilTest/**"
filter { "system:windows" }
    links { "OpenGL32" }

filter { "system:not windows" }
    links { "GL" }

And I have around 20 projects like this. Do you have any idea how to make it sorter as using a list same as cmake ? Such as

projectsList {'1.DepthTest','2.StencilTest'}
func GenerateProject(projectList[i])

Update Finally, I know how to do with my requirement

function GenerateProject(s)
print(s)
project (s)
    kind "ConsoleApp"

    files {
    './' .. s .. '/**.*',
  }
end

for key, value in ipairs(projectsList) do
    GenerateProject(value)
end

Also the projects is generated without structure, I found the question about vpaths in Hide common parent folders of project files in Premake But I still not clear how to do it.

Many thanks, Seal

seal2002
  • 123
  • 1
  • 11
  • It would be helpful to know what kind of structure you are trying to create. – J. Perkins Oct 16 '17 at 17:14
  • Hi @starkos , thank you for reply. Finally, i can create the project with structure. It similar like this [link](https://photos.app.goo.gl/eyn0rGQUjJcTlUnt1) – seal2002 Oct 18 '17 at 06:47
  • Add your standard project structure commands like: `vpaths { ["Source"]={path.join("Projects",s,"**.c*")}, ["Headers"]={path.join("Projects",s,"**.h*")} }` inside the `project(s)` block in your function. – Jesse Chisholm Jun 13 '18 at 19:31
  • Hi @JesseChisholm, Thank you for your suggestion. Unfortunately, it still not generated with the structure I want ... – seal2002 Oct 09 '18 at 14:47

0 Answers0