Commits

Jason McKesson committed 0441291

Allow libraries to be built in a separate solution.

  • Participants
  • Parent commits 2892f5c

Comments (0)

Files changed (4)

 *.cbp
 *.depend
 *.layout
+glloadgen/*

File library_projs.lua

+local libPremakes = 
+{
+	"glload/glload.lua",
+	"glimg/glimg.lua",
+	"glfw/glfw.lua",
+	"freeglut/freeglut.lua",
+	"glutil/glutil.lua",
+	"glmesh/glmesh.lua",
+}
+
+for i, luaPremake in ipairs(libPremakes) do
+	if(#os.matchfiles(luaPremake) ~= 0) then
+		dofile(luaPremake)
+	end
+end
 	end,
 }
 
-local function ProcTable(tbl)
+local InclFuncs =
+{
+	glload = function()
+		includedirs "glload/include"
+		libdirs "glload/lib"
+	end,
+	glimage = function()
+		includedirs "glimg/include"
+		libdirs "glimg/lib"
+	end,
+	glutil = function()
+		includedirs "glutil/include"
+		libdirs "glutil/lib"
+	end,
+	glmesh = function()
+		includedirs "glmesh/include"
+		libdirs "glmesh/lib"
+	end,
+	glm = function()
+		includedirs "glm"
+	end,
+	freeglut = function()
+		includedirs "freeglut/include"
+		libdirs "freeglut/lib"
+		defines {"FREEGLUT_STATIC", "_LIB", "FREEGLUT_LIB_PRAGMAS=0"}
+	end,
+	glfw = function()
+		includedirs "glfw/include"
+		libdirs "glfw/library"
+	end,
+	boost = function()
+		includedirs "boost"
+		defines {"BOOST_ALL_NO_LIB"}
+	end,
+}
+
+local function ProcTable(tbl, libTbl)
 	for i, lib in ipairs(tbl) do
 		if(type(lib) == "string") then
-			if(not LinkFuncs[lib]) then
+			if(not libTbl[lib]) then
 				print("Bad library named ", lib);
 			else
 				local prevDir = os.getcwd()
 				os.chdir(thisDirectory)
 				configuration {}
 
-				LinkFuncs[lib]()
+				libTbl[lib]()
 				
 				configuration {}
 				os.chdir(prevDir)
 
 function UseLibs(...)
 	local libList = {...}
-	ProcTable(libList)
+	ProcTable(libList, LinkFuncs)
 end
+
+function InclLibs(...)
+	local libList = {...}
+	ProcInclTable(libList)
+end

File premake4.lua

 	configurations {"Debug", "Release"}
 	defines(dofile("common_defines.lua"))
 
-
-local libPremakes = 
-{
-	"glload/glload.lua",
-	"glimg/glimg.lua",
-	"glfw/glfw.lua",
-	"freeglut/freeglut.lua",
-	"glutil/glutil.lua",
-	"glmesh/glmesh.lua",
-}
-
-for i, luaPremake in ipairs(libPremakes) do
-	if(#os.matchfiles(luaPremake) ~= 0) then
-		dofile(luaPremake)
-	end
-end
-	
-
+dofile("libraries.lua")