-
Notifications
You must be signed in to change notification settings - Fork 1
/
premake4.lua
151 lines (133 loc) · 5.02 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
150
solution "OgreClientPrototyping"
configurations { "Release" }
build_dir = "build"
targetdir(build_dir)
objdir(build_dir)
location(build_dir)
ogre_dependencies = {
"OgreMain", "OIS", "RenderSystem_Direct3D9", "RenderSystem_GL",
"Plugin_ParticleFX"
}
cegui_dependencies = {
"CEGUIBase", "CEGUIOgreRenderer", "CEGUIExpatParser",
"CEGUIFalagardWRBase"
}
configuration {"Release", "windows", "vs20*"}
includedirs {
"$(OGRE_HOME)/include/OGRE",
"$(OGRE_HOME)/include/OIS",
"$(OGRE_HOME)/boost_1_42",
"$(CEGUI_HOME)/cegui/include",
"$(ZMQ_HOME)/include",
"include",
"libs",
}
libdirs {
"$(OGRE_HOME)/lib/release",
"$(OGRE_HOME)/boost_1_42/lib",
"$(CEGUI_HOME)/lib",
"$(ZMQ_HOME)/lib",
}
links { "OgreMain", "OIS", "CEGUIBase", "CEGUIOgreRenderer", "libzmq" }
buildoptions {"/MD"}
defines { "NDEBUG" }
flags { "Optimize" }
if string.startswith(_ACTION, "vs") then
os.mkdir(build_dir)
os.mkdir(build_dir .. "\\scripts")
os.execute("xcopy cfg\\*.cfg " .. build_dir)
os.execute("xcopy cfg\\win\\*.cfg " .. build_dir)
for k, v in pairs(ogre_dependencies) do
os.execute("xcopy " .. os.getenv("OGRE_HOME") .. "\\bin\\release\\" .. v .. ".dll " .. build_dir)
end
for k, v in pairs(cegui_dependencies) do
os.execute("xcopy " .. os.getenv("CEGUI_HOME") .. "\\bin\\" .. v .. ".dll " .. build_dir)
end
end
configuration {"Release", "linux"}
includedirs {
"/usr/include/OGRE",
"/usr/include/OIS",
"/usr/include/CEGUI",
"include",
"libs",
}
links { "OgreMain", "OIS", "CEGUIBase", "CEGUIOgreRenderer", "zmq" }
if _ACTION ~= "clean" and os.get() == "linux" then
os.mkdir(build_dir)
os.execute("cp cfg/linux/*.cfg " .. build_dir)
os.execute("cp cfg/*.cfg " .. build_dir)
end
configuration {"Release", "macosx"}
platforms { "x32" }
includedirs {
os.getenv('OGRE_HOME') .. "/include/OGRE",
os.getenv('OGRE_HOME') .. "/include/OIS",
os.getenv('OGRE_HOME') .. "/boost_1_42",
"/Library/Frameworks/CEGUIBase.framework/Headers",
"/Library/Frameworks/CEGUIOgreRenderer.framework/Headers",
"include",
"libs",
}
buildoptions { "-fvisibility=hidden" }
libdirs { os.getenv('OGRE_HOME') .. "/lib/release" }
links { "OIS", "Ogre.framework", "CEGUIBase.framework",
"CEGUILuaScriptModule.framework", "CEGUIOgreRenderer.framework",
"Carbon.framework", "Cocoa.framework", "IOKit.framework", "zmq" }
if _ACTION ~= "clean" and os.get() == "macosx" then
os.mkdir(build_dir)
os.mkdir(build_dir .. "/Contents")
os.mkdir(build_dir .. "/Contents/Resources")
os.mkdir(build_dir .. "/Contents/Plugins")
os.execute("cp " .. os.getenv('OGRE_HOME') .. "/lib/*.dylib " .. build_dir .. "/Contents/Plugins")
os.execute("cp -r " .. os.getenv('CEGUI_HOME') .. "/PlugInBundles/Release/*.bundle " .. build_dir .. "/Contents/Plugins")
--os.execute("cp cfg/osx/*.cfg " .. build_dir .. "/Contents/Resources")
os.execute("cp cfg/*.cfg " .. build_dir)
os.execute("cp cfg/osx/* " .. build_dir)
end
project "Network"
language "C++"
kind "StaticLib"
files { "**.h", "src/network/*.cpp", "libs/cJSON.c" }
project "Graphics"
language "C++"
kind "StaticLib"
files { "**.h", "src/graphics/*.cpp" }
project "Scenes"
language "C++"
kind "StaticLib"
files { "**.h", "src/scenes/*.cpp" }
project "App"
language "C++"
kind "StaticLib"
files { "**.h", "src/app/*.cpp" }
project "Prototype"
language "C++"
kind "ConsoleApp"
links { "Network", "Graphics", "Scenes", "App" }
files { "**.h", "src/main/ogreclient.cpp" }
project "TestCache"
language "C++"
kind "ConsoleApp"
links { "Network" }
files { "**.h", "src/main/testcache.cpp" }
project "SceneMgrEnum"
language "C++"
kind "ConsoleApp"
files { "src/main/scenemgr.cpp" }
project "Test"
language "C++"
kind "ConsoleApp"
includedirs { "libs/UnitTest++/src" }
libdirs { "libs/UnitTest++/build" }
links { "UnitTest" }
files { "**.h", "tests/**.cpp" }
configuration { "Debug*" }
defines { "_DEBUG", "DEBUG" }
flags { "Symbols" }
configuration { "Release*" }
defines { "NDEBUG" }
flags { "Optimize" }
if _ACTION == "clean" then
os.rmdir(build_dir)
end