-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConstruct
More file actions
102 lines (90 loc) · 2.53 KB
/
SConstruct
File metadata and controls
102 lines (90 loc) · 2.53 KB
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
# SConstruct - root SCons script for SuperSpaceShipsShootingStuff
from scons_common import *
import os
import glob
# Tries to detect the path to the installation of Qt with
# the highest version number
def detectLatestQtDir():
if sys.platform.startswith("linux"):
# Simple check: inspect '/usr/share/qt' and then '/usr/local/Trolltech/*'
paths = glob.glob('/usr/share/*')
if len(paths):
for p in paths:
if p == "/usr/share/qt":
return p
paths = glob.glob('/usr/local/Trolltech/*')
if len(paths):
paths.sort()
return paths[-1]
else:
return os.environ.get("QTDIR")
else:
# Simple check: inspect only 'C:\Qt'
paths = glob.glob('C:\\Qt\\*')
if len(paths):
paths.sort()
return paths[-1]
else:
return os.environ.get("QTDIR")
###### Sconstruct ######
env = createEnvironment(generate_help=True) # generate the help
qtdir = detectLatestQtDir()
if not qtdir:
qtdir = os.environ.get('QT4DIR')
if not qtdir :
print "You must define the QT4DIR environment variable"
exit(1)
if os.name == 'posix':
env['LINK'] = 'g++' # We got some problem of gcc being used instead of g++ when using VariantDir()...
env['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig')
env['QT4DIR'] = qtdir
env['QT4_DEBUG'] = 1
env.Tool('qt4')
env.EnableQt4Modules([
'QtGui',
'QtCore',
'QtOpenGL',
'QtXml'
])
env.Append(LFLAGS=['-Wl'])
env.Append(RPATH=[os.path.join(qtdir, 'lib')])
### Libs
# core
env.Append(LIBS=['-lpthread','-lm'])
# gui
if sys.platform.startswith("linux"):
env.Append(LIBS=['-lXext','-lX11'])
# opengl
if env['PLATFORM'] == 'win32':
env.Append(LIBPATH=['dep/glew/lib-win32'])
env.Append(CPPPATH = ['dep/glew/include'])
env.Append(LIBS=['-lopengl32','-lglew32','-lglu32'])
else:
env.Append(LIBS=['-lGL','-lGLU','-lGLEW'])
# openal
if env['PLATFORM'] == 'win32':
env.Append(CPPPATH=['dep/openal/include'])
env.Append(LIBPATH=['dep/openal/lib-win32'])
env.Append(LIBS=['-lOpenAL32','-lalut'])
else:
env.Append(LIBS=['-lopenal','-lalut'])
# assimp
if env['PLATFORM'] == 'win32':
env.Append(LIBPATH=['dep/assimp/lib-win32'])
else:
env.Append(LIBPATH=['dep/assimp/lib'])
env.Append(CPPPATH = ['dep/assimp/include'])
env.Append(LIBS=['-lassimp'])
# bullet
env.Append(LIBS=
['BulletSoftBody',
'BulletDynamics',
'BulletCollision',
'LinearMath'])
if env['PLATFORM'] == 'win32':
env.Append(CPPPATH=['dep/bullet/src'])
env.Append(LIBPATH=['dep/bullet/lib-win32'])
else:
env.ParseConfig('pkg-config bullet --cflags --libs')
SConscript('SConscript_S5engine','env')
SConscript('SConscript_demo_game','env')