/
premake4.lua
149 lines (120 loc) · 4.03 KB
/
premake4.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
-------------------------------------------------------------------------------
---- Plasma Premake File
---- -> Main solution
----
---- Author: Chirag Sangani
---- csangani@stanford.edu
----
---- Date: 5/23/2013
-------------------------------------------------------------------------------
-- Project Defines.
SolutionName = "Plasma"
Platforms = { "native" }
Debug = "Debug"
Release = "Release"
BuildPath = "build/"
LibPath = "lib/"
IncludePath = "include/"
Defines = { "FREEGLUT_STATIC", "GLEW_STATIC", "_USE_MATH_DEFINES",
"_SCL_SECURE_NO_WARNINGS", "_CRT_SECURE_NO_WARNINGS" }
DebugFlags = { "Symbols", "StaticRuntime", "EnableSSE2", "FloatFast" }
ReleaseFlags = { "OptimizeSpeed", "StaticRuntime", "EnableSSE2",
"FloatFast" }
-- Convenience defines.
IncludeDirs = { IncludePath, "Bullet/" }
Configurations = { Debug, Release }
DebugBuildPath = path.join ((BuildPath), (Debug))
ReleaseBuildPath = path.join ((BuildPath), (Release))
DebugLibPath = path.join ((LibPath), (Debug))
ReleaseLibPath = path.join ((LibPath), (Release))
-- Static library definitions.
CPP = "C++"
C = "C"
function DefineStaticLib (ProjectName, ProjectDir, TargetDir, Language)
project (ProjectName)
kind "StaticLib"
language (Language)
location (ProjectDir)
targetname (ProjectName)
includedirs (IncludeDirs)
if Language == C then
files { path.join(path.join (IncludePath, ProjectDir), "**.h"),
path.join(ProjectDir, "**.h"),
path.join(ProjectDir, "**.c"),
path.join(ProjectDir, "**.rc") }
elseif Language == CPP then
files { path.join(path.join (IncludePath, ProjectDir), "**.h"),
path.join(path.join (IncludePath, ProjectDir), "**.hh"),
path.join(path.join (IncludePath, ProjectDir), "**.hpp"),
path.join(ProjectDir, "**.h"),
path.join(ProjectDir, "**.hh"),
path.join(ProjectDir, "**.hpp"),
path.join(ProjectDir, "**.cc"),
path.join(ProjectDir, "**.cpp"),
path.join(ProjectDir, "**.rc") }
else
error ("Invalid language specified.", 2)
end
configuration (Debug)
defines (Defines)
flags (DebugFlags)
targetdir (path.join (DebugLibPath, TargetDir))
objdir (path.join (DebugBuildPath, TargetDir))
configuration (Release)
defines (Defines)
flags (ReleaseFlags)
targetdir (path.join (ReleaseLibPath, TargetDir))
objdir (path.join (ReleaseBuildPath, TargetDir))
end
-- Define the solution.
solution (SolutionName)
configurations (Configurations)
platforms (Platforms)
-- Spline
Spline = "Spline"
DefineStaticLib (Spline, "Spline/", "Spline/", CPP)
-- PolyMesh
PolyMesh = "PolyMesh"
DefineStaticLib (PolyMesh, "PolyMesh/", "PolyMesh/", CPP)
-- OpenMesh
OpenMeshCore = "OpenMeshCore"
DefineStaticLib (OpenMeshCore, "OpenMesh/Core/", "OpenMesh/Core/", CPP)
-- GLEW
GLEW = "GLEW"
DefineStaticLib (GLEW, "GLEW/", "GLEW/", C)
-- FreeGLUT
FreeGLUT = "FreeGLUT"
DefineStaticLib (FreeGLUT, "FreeGLUT/", "FreeGLUT/", C)
-- Bullet
Bullet = "Bullet"
DefineStaticLib (Bullet, "Bullet/", "Bullet/", CPP)
-- Shad
Shad = "Shad"
project (Shad)
kind "ConsoleApp"
language "C++"
location ("Shad/")
targetname (Shad)
includedirs (IncludeDirs)
files { path.join (IncludePath, "Shad/**.h"),
path.join (IncludePath, "Shad/**.hh"),
path.join (IncludePath, "Shad/**.hpp"),
"Shad/**.cpp", "Shad/**.rc" }
links { Spline, OpenMeshCore, GLEW, FreeGLUT, PolyMesh, Bullet,
path.join (path.join ("../", LibPath), "FMODex/FMODex") }
configuration "Debug"
defines (Defines)
flags (DebugFlags)
targetdir (DebugBuildPath)
libdirs { DebugLibPath }
objdir (path.join (DebugBuildPath, "Shad/"))
postbuildcommands { "xcopy Assets ..\\Build\\Debug\\Assets /E /I /Y",
"xcopy dll\\* ..\\Build\\Debug /E /I /Y" }
configuration "Release"
defines (Defines)
flags (ReleaseFlags)
targetdir (ReleaseBuildPath)
libdirs { ReleaseLibPath }
objdir (path.join (ReleaseBuildPath, "Shad/"))
postbuildcommands { "xcopy Assets ..\\Build\\Release\\Assets /E /I /Y",
"xcopy dll\\* ..\\Build\\Release /E /I /Y" }