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
|
import os
Import('env qt_env')
def InstallModule(self, arg, subdir = None):
install_dir = '${INSTALL_PATH}'
if subdir is not None:
install_dir = os.path.join(install_dir, subdir)
# Ensure we install this when built from here, not just from top level build
self.Pseudo('install')
self.Depends('install',
self.Install(install_dir,
filter(lambda x: x.suffix in ('.dll', '.pdb', '.exe'),
arg)))
def RequireLibraries(self, *libraries):
# Cannot use env.AppendUnique because it confuses moc
# self['CPPPATH'] += [
# os.path.join('..', '..', library) for library in libraries
# ]
self.AppendUnique(CPPPATH = [
os.path.join('..', library) for library in libraries
])
self.AppendUnique(LIBPATH = [
os.path.join('..', library) for library in libraries
])
libs = list(libraries)
try:
idx = libs.index('shared')
libs[idx] = 'mo_shared'
except:
pass
self.AppendUnique(LIBS = [ library for library in libs ])
qt_env = qt_env.Clone()
qt_env.AddMethod(InstallModule)
qt_env.AddMethod(RequireLibraries)
env = env.Clone()
env.AddMethod(InstallModule)
env.AddMethod(RequireLibraries)
libs_to_install = env.SConscript(env.Glob('*/SConscript'),
exports = 'env qt_env')
dll_manifest = 'dlls.manifest'
if qt_env['CONFIG'] == 'debug':
dll_manifest += '.debug'
if qt_env['QT_MAJOR_VERSION'] > 4:
dll_manifest += '.qt%d' % qt_env['QT_MAJOR_VERSION']
qt_env.InstallAs(os.path.join(qt_env['INSTALL_PATH'], 'DLLs', 'dlls.manifest'),
dll_manifest)
Return('libs_to_install')
|