ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/SConscript
Revision: 1.23
Committed: Mon Jan 8 13:38:37 2018 UTC (6 years, 3 months ago) by schorsch
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad5R3, HEAD
Changes since 1.22: +12 -8 lines
Log Message:
Updating to SCons 3.x, adding support for Python 3

File Contents

# User Rev Content
1 schorsch 1.23 from __future__ import division, print_function, unicode_literals
2    
3 schorsch 1.1 import os
4    
5     Import('env') # inherit from parent
6    
7 schorsch 1.7 mlib = ['$RAD_MLIB']
8     progs = []
9 schorsch 1.1
10     # compose paths
11 schorsch 1.7 def radbin(name): return os.path.join('$RAD_BUILDBIN', name)
12     def radlib(name): return os.path.join('$RAD_BUILDLIB', name)
13 schorsch 1.20 def tclscr(name): return os.path.join('$RAD_BUILDRLIB', 'tcl', name)
14 schorsch 1.1
15 schorsch 1.20 cmatrix = env.Object(source='cmatrix.c')
16     cmbsdf = env.Object(source='cmbsdf.c')
17 schorsch 1.2
18 schorsch 1.1 # standard targets
19     PROGS = [
20 schorsch 1.21 ('findglare', Split('findglare.c glareval.c glaresrc.c setscan.c'), ['rtrad']),
21     ('glarendx', Split('glarendx.c'), ['rtrad']),
22     ('vwright', Split('vwright.c'), ['rtrad']),
23     ('vwrays', Split('vwrays.c'), ['rtrad']),
24     ('rad', Split('rad.c'), ['rtrad']),
25     ('rpiece', Split('rpiece.c') + [env.version], ['rtrad']),
26     ('ranimate', ['ranimate.c', '$RAD_NETCOMPAT'], ['rtrad', '$RAD_SOCKETLIB']),
27     ('dctimestep', Split('dctimestep.c')+[cmatrix, cmbsdf], ['rtrad']),
28     ('rttree_reduce', Split('rttree_reduce.c'), ['rtrad']),
29     ('rcollate', Split('rcollate.c'), ['rtrad']),
30     ('eplus_adduvf', Split('eplus_adduvf.c eplus_idf.c'), ['rtrad']),
31     ('rfluxmtx', Split('rfluxmtx.c'), ['rtrad']),
32     ('rmtxop', Split('rmtxop.c rmatrix.c')+[cmatrix, cmbsdf], ['rtrad']),
33     ('wrapBSDF', Split('wrapBSDF.c'), ['rtrad']),
34     ('evalglare', Split('evalglare.c pictool.c'), ['rtrad', 'reetz']),
35 schorsch 1.1 ]
36 schorsch 1.12
37 schorsch 1.1 for p in PROGS:
38 schorsch 1.2 prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
39 schorsch 1.7 progs.append(prog)
40 schorsch 1.1
41 schorsch 1.20 # targets with different includes/libs
42     rs = Split('ranimove.c ranimove1.c ranimove2.c')
43     ranimove = env.Program(target=radbin('ranimove'), source=rs,
44     CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'],
45 schorsch 1.21 LIBS=['raycalls','rttrace','rtrad'] + mlib)
46 schorsch 1.20 progs.append(ranimove)
47     rsensor = env.Program(target=radbin('rsensor'), source='rsensor.c',
48     CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'],
49 schorsch 1.21 LIBS=['raycalls','rttrace','rtrad'] + mlib)
50 schorsch 1.20 progs.append(rsensor)
51 schorsch 1.1
52 schorsch 1.2 getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c',
53 schorsch 1.21 LIBS=['rtrad'])
54 schorsch 1.7 progs.append(getinfo)
55 schorsch 1.1
56    
57     # X11 targets
58 schorsch 1.2 if env.has_key('X11LIB'):
59 schorsch 1.22 addobj = env.get('ADDOBJNOTIFY')
60 schorsch 1.7 xincl = env.get('CPPPATH', []) + ['$X11INCLUDE']
61     xlibp = env.get('LIBPATH', []) + ['$X11LIB']
62 schorsch 1.2 xglaresrc = env.Program(target=radbin('xglaresrc'),
63 schorsch 1.16 source=Split('xglaresrc.c') + [env.x11findwind], # XXX remote magic
64 schorsch 1.2 LIBPATH=xlibp, CPPPATH=xincl,
65 schorsch 1.21 LIBS=['rtrad', 'X11']+ mlib)
66 schorsch 1.7 progs.append(xglaresrc)
67 schorsch 1.2
68     # OpenGL targets that also depend on X11
69     if env.has_key('OGL'):
70 schorsch 1.22 glrad = env.Program(target=radbin('glrad'),
71     source=['glrad.c', addobj],
72     CPPFLAGS=env.get('CPPFLAGS', []) + ['$RAD_STEREO'],
73     LIBPATH=xlibp, CPPPATH=xincl,
74     LIBS=['rgl','rtrad','GL', 'GLU','X11'] + mlib,)
75 schorsch 1.7 progs.append(glrad)
76 schorsch 1.1
77 schorsch 1.23 pyscripts = Split('''rlux''')
78     if os.name == 'posix':
79 schorsch 1.20 for s in Split('''objline glare dayfact
80 schorsch 1.23 debugcal raddepend compamb vinfo fieldcomb'''):
81 schorsch 1.19 Default(env.InstallScript(radbin(s), s + '.csh'))
82 schorsch 1.20 for s in Split('''objview objpict
83 schorsch 1.23 genambpos genklemsamp genskyvec genBSDF bsdfview ltview ltpict'''):
84 schorsch 1.20 Default(env.InstallScript(radbin(s), s + '.pl'))
85     for s in Split('''do_action.tcl do_file.tcl do_options.tcl do_results.tcl
86     do_scene.tcl do_views.tcl do_zone.tcl file.hlp getfile.tcl gethelp.tcl
87     help.hlp tclIndex trad.hlp trad.icon util.tcl'''):
88     Default(env.InstallScript(tclscr(s), s))
89     Default(env.InstallTCLScript(radbin('trad'), 'trad.wsh'))
90 schorsch 1.23 for s in pyscripts:
91     Default(env.InstallScript(radbin(s), s + '.py'))
92     else:
93     for s in pyscripts:
94     Default(env.InstallScript(radbin(s + '.py'), s + '.py'))
95 schorsch 1.20
96 schorsch 1.7
97     Default('#src/util')
98     env.Install('$RAD_BINDIR', progs)
99 schorsch 1.1
100 schorsch 1.20 # vim: set syntax=python:
101 schorsch 1.23 # vi: set ts=4 sw=4 :