forked from mgear-dev/mgear4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
134 lines (114 loc) · 3.25 KB
/
SConstruct
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
import os
import sys
import excons
import excons.config
import excons.tools.maya as maya
import excons.tools.gl as gl
maya.SetupMscver()
env = excons.MakeBaseEnv()
version = (4, 1, 0)
versionstr = "%d.%d.%d" % version
platname = {"win32": "windows", "darwin": "osx"}.get(sys.platform, "linux")
outprefix = "platforms/%s/%s/%s/plug-ins" % (
maya.Version(nice=True),
platname,
excons.arch_dir,
)
outdir = excons.OutputBaseDirectory()
gen = excons.config.AddGenerator(
env,
"mgear",
{
"MGEAR_VERSION": "[%d, %d, %d]" % version,
"MGEAR_MAJMIN_VERSION": "%d.%d" % (version[0], version[1]),
"MGEAR_VERSION_MAJOR": "%d" % version[0],
"MGEAR_VERSION_MINOR": "%d" % version[1],
"MGEAR_VERSION_PATCH": "%d" % version[2],
},
)
# mgearmod = gen("mGear.mod", "mGear.mod.in")
mgearpy = filter(
lambda x: not os.path.basename(x).startswith("__init__.py"),
excons.glob("scripts/mgear/*"),
)
qtpy = ["vendor/Qtdotpy/Qt.py"]
qjason = ["vendor/QJsonModel/qjsonmodel.py"]
# NoClean(mgearmod)
defines = []
if sys.platform == "win32":
defines.append("NOMINMAX")
def maya_math_nodes_setup(env):
env.Append(CPPDEFINES=[("NODE_NAME_PREFIX", '"\\"math_\\""')])
env.Append(CCFLAGS=["-Os"])
env.Append(CPPFLAGS=' -DPROJECT_VERSION="\\"1.4.0\\""')
def CVWrapSetup(env):
if sys.platform == "win32":
env.Append(CCFLAGS=["/arch:AVX"])
else:
env.Append(CCFLAGS=["-mavx"])
targets = [
{
"name": "mgear_core",
"type": "install",
"desc": "mgear core python modules",
"install": {"scripts/mgear/vendor": qjason + qtpy},
},
{
"name": "mgear_solvers",
"type": "dynamicmodule",
"desc": "mgear solvers plugin",
"prefix": outprefix,
"bldprefix": maya.Version(),
"ext": maya.PluginExt(),
"defs": defines,
"incdirs": ["plugins/mgear_solvers/src"],
"srcs": excons.glob("src/*.cpp"),
"custom": [maya.Require],
},
{
"name": "weightDriver",
"type": "dynamicmodule",
"desc": "weightDriver node",
"prefix": outprefix,
"bldprefix": maya.Version(),
"ext": maya.PluginExt(),
"defs": defines,
"incdirs": ["vendor/weightDriver"],
"srcs": excons.glob("vendor/weightDriver/source/*.cpp"),
"custom": [maya.Require, gl.Require],
"install": {
"scripts": excons.glob(
"vendor/weightDriver/modules/weightDriver/scripts/*"
)
},
},
]
excons.AddHelpTargets(
mgear="mgear maya framework"
" (mgear_core, mgear_solvers, weightDriver)"
)
td = excons.DeclareTargets(env, targets)
env.Alias(
"mgear",
[
td["mgear_core"],
td["mgear_solvers"],
td["weightDriver"],
],
)
td["python"] = filter(
lambda x: os.path.splitext(str(x))[1] != ".mel", Glob(outdir + "scripts/*")
)
td["scripts"] = Glob(outdir + "scripts/*.mel")
pluginsdir = "/plug-ins/%s/%s" % (
maya.Version(nice=True),
excons.EcosystemPlatform(),
)
ecodirs = {
"mgear_solvers": pluginsdir,
"weightDriver": pluginsdir,
"python": "/python",
"scripts": "/scripts",
}
excons.EcosystemDist(env, "mgear.env", ecodirs, version=versionstr, targets=td)
Default(["mgear"])