forked from ahmidou/SpliceSoftimage
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConscript
212 lines (177 loc) · 7.2 KB
/
SConscript
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#
# Copyright (c) 2010-2017 Fabric Software Inc. All rights reserved.
#
import os, sys, platform, copy
Import(
'parentEnv',
'FABRIC_DIR',
'FABRIC_SPLICE_VERSION',
'STAGE_DIR',
'FABRIC_BUILD_OS',
'FABRIC_BUILD_TYPE',
'FABRIC_BUILD_ARCH',
'SOFTIMAGE_INCLUDE_DIR',
'SOFTIMAGE_LIB_DIR',
'SOFTIMAGE_VERSION',
'sharedCapiFlags',
'spliceFlags',
'commandsFlags',
'astWrapperFlags',
'codeCompletionFlags',
)
env = parentEnv.Clone()
softimageFlags = {
'CPPPATH': [
SOFTIMAGE_INCLUDE_DIR
],
'LIBPATH': [
SOFTIMAGE_LIB_DIR,
],
}
softimageFlags['LIBS'] = ['sicoresdk', 'sicppsdk']
if FABRIC_BUILD_OS == 'Windows':
softimageFlags['CCFLAGS'] = ['/DNT_PLUGIN']
elif FABRIC_BUILD_OS == 'Linux':
softimageFlags['CCFLAGS'] = ['-DLINUX']
env.MergeFlags(softimageFlags)
env.Append(CPPDEFINES = ["_SPLICE_SOFTIMAGE_VERSION="+str(SOFTIMAGE_VERSION[:4])])
shibokenPysideDir = env.Dir('')
if FABRIC_BUILD_OS == 'Linux':
shibokenPysideDir = env.Dir(os.environ['SHIBOKEN_PYSIDE_DIR'])
qtDir = None
if FABRIC_BUILD_OS == 'Windows':
if FABRIC_BUILD_TYPE == 'Release':
qtDir = env.Dir('#').Dir('ThirdParty').Dir('PreBuilt').Dir(FABRIC_BUILD_OS).Dir(FABRIC_BUILD_ARCH).Dir('VS2013').Dir('Release').Dir('qt-fabric').Dir('4.8.6')
else:
qtDir = env.Dir('#').Dir('ThirdParty').Dir('PreBuilt').Dir(FABRIC_BUILD_OS).Dir(FABRIC_BUILD_ARCH).Dir('VS2013').Dir('Release').Dir('qt').Dir('4.8.6')
if os.environ.has_key('QT_DIR'):
qtDir = env.Dir(os.environ['QT_DIR'])
if qtDir:
env.Append(CPPPATH = [
os.path.join(qtDir.abspath, 'include' ),
os.path.join(qtDir.abspath, 'include', 'QtCore'),
os.path.join(qtDir.abspath, 'include', 'QtGui'),
os.path.join(qtDir.abspath, 'include', 'QtOpenGL'),
])
env.Append(LIBPATH = [os.path.join(qtDir.abspath, 'lib')])
env.MergeFlags(sharedCapiFlags)
env.MergeFlags(spliceFlags)
if FABRIC_BUILD_OS == 'Linux':
exportsFile = env.File('Linux.exports').srcnode()
env.Append(SHLINKFLAGS = ['-Wl,--version-script='+str(exportsFile)])
elif FABRIC_BUILD_OS == 'Windows':
env.Append(LIBS = ['OpenGL32.lib'])
env.Append(LIBS = ['user32.lib'])
if len(commandsFlags.keys()) > 0:
env.MergeFlags(commandsFlags)
env.MergeFlags(astWrapperFlags)
env.MergeFlags(codeCompletionFlags)
else:
if FABRIC_BUILD_OS == 'Windows':
if FABRIC_BUILD_TYPE == 'Release':
env.Append(LIBS = ['FabricServices-MSVC-'+env['MSVC_VERSION']+'-mt'])
else:
env.Append(LIBS = ['FabricServices-MSVC-'+env['MSVC_VERSION']+'-mtd'])
else:
env.Append(LIBS = ['FabricServices'])
env.Append(LIBS = ['FabricSplitSearch'])
uiLibPrefix = 'uiSoftimage'+str(SOFTIMAGE_VERSION)
uiDir = env.Dir('#').Dir('Native').Dir('FabricUI')
if os.environ.has_key('FABRIC_UI_DIR'):
uiDir = env.Dir(os.environ['FABRIC_UI_DIR'])
uiSconscript = uiDir.File('SConscript')
if not os.path.exists(uiSconscript.abspath):
print "Error: You need to have FabricUI checked out to "+uiSconscript.dir.abspath
env.Append(LIBPATH = [os.path.join(os.environ['FABRIC_DIR'], 'lib')])
env.Append(CPPPATH = [os.path.join(os.environ['FABRIC_DIR'], 'include')])
env.Append(CPPPATH = [os.path.join(os.environ['FABRIC_DIR'], 'include', 'FabricServices')])
env.Append(CPPPATH = [uiSconscript.dir])
if qtDir:
qtIncludeDir = os.path.join(qtDir.abspath, 'include', 'Qt')
qtMocBin = os.path.join(qtDir.abspath, 'bin', 'moc')
uiLibs = SConscript(uiSconscript, exports = {
'parentEnv': env,
'uiLibPrefix': uiLibPrefix,
'qtDir': qtIncludeDir,
'qtMOC': qtMocBin,
'qtFlags': {
},
'fabricFlags': sharedCapiFlags,
'buildType': FABRIC_BUILD_TYPE,
'buildOS': FABRIC_BUILD_OS,
'buildArch': FABRIC_BUILD_ARCH,
'stageDir': env.Dir('#').Dir('stage').Dir('lib'),
'shibokenPysideDir': shibokenPysideDir,
},
duplicate=0,
variant_dir = env.Dir('FabricUI')
)
# import the softimage specific libraries
Import(uiLibPrefix+'Flags')
# ui flags
env.MergeFlags(locals()[uiLibPrefix + 'Flags'])
if qtDir:
env.Append(LIBPATH = [os.path.join(qtDir.abspath, 'lib')])
if FABRIC_BUILD_OS == 'Windows':
if FABRIC_BUILD_TYPE == 'Release':
if os.path.exists(os.path.join(qtDir.abspath, 'lib', 'QtCoreFabric4.lib')):
env.Append(LIBS = ['QtCoreFabric4'])
env.Append(LIBS = ['QtGuiFabric4'])
env.Append(LIBS = ['QtOpenGLFabric4'])
elif os.path.exists(os.path.join(qtDir.abspath, 'lib', 'QtCore4.lib')):
env.Append(LIBS = ['QtCore4'])
env.Append(LIBS = ['QtGui4'])
env.Append(LIBS = ['QtOpenGL4'])
else:
raise(Exception('QtCoreFabric4.lib or QtCore4.lib not found on '+qtDir.abspath))
else:
env.Append(LIBS = ['QtCored4'])
env.Append(LIBS = ['QtGuid4'])
env.Append(LIBS = ['QtOpenGLd4'])
else:
env.Append(LIBS = ['QtCore'])
env.Append(LIBS = ['QtGui'])
env.Append(LIBS = ['QtOpenGL'])
target = 'FabricSoftimage'
softimageModule = env.SharedLibrary(target = target, source = Glob('*.cpp'), SHLIBPREFIX='')
if FABRIC_BUILD_OS == 'Linux':
env.Depends(softimageModule, exportsFile)
softimageFiles = []
installedModule = env.Install(os.path.join(STAGE_DIR.abspath, 'Application', 'Plugins'), softimageModule)
softimageFiles.append(installedModule)
softimageFiles.append(env.Install(os.path.join(STAGE_DIR.abspath, 'Application', 'UI'), os.path.join('UI', 'FE_logo.bmp')))
softimageFiles.append(env.Install(os.path.join(STAGE_DIR.abspath, 'Application', 'UI'), os.path.join('UI', 'FE_exclamation.bmp')))
softimageFiles.append(env.Install(os.path.join(STAGE_DIR.abspath, 'Data', 'Compounds'), os.path.join('ICE_Compounds', 'Fabric Canvas Set Normals.xsicompound')))
softimageFiles.append(env.Install(os.path.join(STAGE_DIR.abspath, 'Data', 'Compounds'), os.path.join('ICE_Compounds', 'Fabric Canvas Set UVWs.xsicompound')))
softimageFiles.append(env.Install(os.path.join(STAGE_DIR.abspath, 'Data', 'Compounds'), os.path.join('ICE_Compounds', 'Fabric Canvas Set Colors.xsicompound')))
softimageFiles.append(env.Install(os.path.join(STAGE_DIR.abspath, 'Application', 'Plugins'), 'FabricCanvasInspectOp.vbs'))
softimageFiles.append(env.Install(os.path.join(STAGE_DIR.abspath, 'Application', 'Plugins'), 'FabricEnginePython.py'))
softimageFiles.append(env.Install(STAGE_DIR, env.File('license.txt')))
# also install the FabricCore dynamic library
if FABRIC_BUILD_OS == 'Linux':
env.Append(LINKFLAGS = [Literal('-Wl,-rpath,$ORIGIN/../../../../lib/')])
if FABRIC_BUILD_OS == 'Windows':
FABRIC_CORE_VERSION = FABRIC_SPLICE_VERSION.rpartition('.')[0]
softimageFiles.append(
env.Install(
os.path.join(STAGE_DIR.abspath, 'Application', 'Plugins'),
[
env.Glob(os.path.join(FABRIC_DIR, 'bin', 'Fabric*.dll')),
env.Glob(os.path.join(qtDir.abspath, 'lib', 'QtCore*.dll')),
env.Glob(os.path.join(qtDir.abspath, 'lib', 'QtGui*.dll')),
env.Glob(os.path.join(qtDir.abspath, 'lib', 'QtOpenGL*.dll')),
os.path.join(FABRIC_DIR, 'bin', 'tbb.dll'),
os.path.join(FABRIC_DIR, 'bin', 'tbbmalloc.dll'),
]
)
)
softimageFiles.append(
env.Install(
os.path.join(STAGE_DIR.abspath, 'Application', 'Plugins'),
os.path.join(FABRIC_DIR, 'bin', 'FabricCore-' + FABRIC_CORE_VERSION + '.pdb')
)
)
# todo: install the python client
alias = env.Alias('splicesoftimage', softimageFiles)
spliceData = (alias, softimageFiles)
Return('spliceData')