ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/SConstruct
Revision: 1.19
Committed: Tue Apr 19 21:21:23 2016 UTC (8 years, 5 months ago) by schorsch
Branch: MAIN
CVS Tags: rad5R1
Changes since 1.18: +13 -16 lines
Log Message:
Build with VC2013 until text pipe bug is fixed; prepare for pyinstaller on scripts

File Contents

# Content
1
2 import os
3 import sys
4 import string
5
6 PATHFILE = 'scbuild/raypaths.py'
7 OPTFILE = 'scbuild/rayopts.py'
8 def set_pre_opts():
9 vars = Variables(OPTFILE, ARGUMENTS)
10 vars.Add('SKIP', 'Skip Display of License terms', 0)
11 vars.Add('RAD_DEBUG', 'Build a debug version', 0)
12 vars.Add('MSVC_VERSION', 'Microsoft VC Version', '12.0')
13 vars.Add('TARGET_ARCH', 'Windows only: "x68" or "amd64"', '')
14 return vars
15
16 def set_opts(env):
17 vars = Variables(PATHFILE, ARGUMENTS)
18 vars.Add('RAD_BINDIR', 'Install executables here', env['RAD_BINDIR'])
19 vars.Add('RAD_RLIBDIR', 'Install support files here', env['RAD_RLIBDIR'])
20 vars.Add('RAD_MANDIR', 'Install man pages here', env['RAD_MANDIR'])
21 vars.Update(env)
22 vars.Save(PATHFILE, env)
23 Help(vars.GenerateHelpText(env, sort=cmp))
24 # where stuff is located in the source tree
25 # the binary target libs are configured by platform
26 env['RAD_BUILDRLIB'] = '#lib'
27 env['RAD_BUILDMAN'] = '#doc/man'
28
29 def allplats_setup(env):
30 from build_utils import find_libs
31 find_libs.find_radlib(env)
32 find_libs.find_x11(env)
33 find_libs.find_gl(env) # OpenGL
34 find_libs.find_libtiff(env)
35 find_libs.find_pyinstaller(env)
36
37 def post_common_setup(env):
38 env.Append(CPPPATH = [os.path.join('#src', 'common')])
39 env.Append(LIBPATH=[env['RAD_BUILDLIB']]) # our own libs
40 if not env.has_key('RAD_MLIB'):
41 env['RAD_MLIB'] = [] #['m'] # no seperate mlib on Win
42
43 def shareinstall_setup(env):
44 from build_utils import install
45 # only scan for those files when we actually need them
46 if 'install' in sys.argv or 'rlibinstall' in sys.argv:
47 install.install_rlibfiles(env)
48 if 'install' in sys.argv or 'maninstall' in sys.argv:
49 install.install_manfiles(env)
50
51
52 # set stuff before loading platforms
53 prevars = set_pre_opts()
54 # Set up build environment
55 env = Environment(variables=prevars)
56 prevars.Save(OPTFILE, env)
57 env.Decider('timestamp-match')
58
59 from build_utils import install
60 script_b = Builder(action = install.install_script, suffix = '')
61 env.Append(BUILDERS={'InstallScript': script_b})
62 if os.name == 'posix':
63 tclscript_b = Builder(action = install.install_tclscript, suffix = '')
64 env.Append(BUILDERS={'InstallTCLScript': tclscript_b})
65
66
67 # configure platform-specific stuff
68 from build_utils import load_plat
69 load_plat.load_plat(env)
70
71 # override options
72 set_opts(env)
73
74 # accept license
75 if ((not env['SKIP']
76 or env['SKIP'].strip().lower() in (0,'0','n','no','false',None))
77 and not '-c' in sys.argv and not 'test' in sys.argv):
78 from build_utils import copyright
79 copyright.show_license()
80
81 # fill in generic config
82 allplats_setup(env)
83
84 # Bring in all the actual things to build
85 Export('env')
86 if 'test' in sys.argv:
87 SConscript(os.path.join('test', 'SConscript'))
88
89 else:
90 SConscript(os.path.join('src', 'common', 'SConscript'),
91 variant_dir=os.path.join(env['RAD_BUILDOBJ'],'common'), duplicate=0)
92 post_common_setup(env)
93 dirs = Split('''meta cv gen ot rt px hd util cal''')
94 if os.path.isfile('src/winimage/SConscript'):
95 dirs.append('winimage')
96 if os.path.isfile('src/winrview/SConscript'):
97 dirs.append('winrview')
98 for d in dirs:
99 print(d)
100 SConscript(os.path.join('src', d, 'SConscript'),
101 variant_dir=os.path.join(env['RAD_BUILDOBJ'], d), duplicate=0)
102
103 if string.find(string.join(sys.argv[1:]), 'install') > -1:
104 shareinstall_setup(env)
105
106 Default('.')
107
108 # virtual targets
109 env.Alias('bininstall', '$RAD_BINDIR')
110 env.Alias('rlibinstall', '$RAD_RLIBDIR')
111 env.Alias('maninstall', '$RAD_MANDIR')
112
113 env.Alias('build', ['$RAD_BUILDBIN', '$RAD_BUILDRLIB'])
114 env.Alias('test', ['#test'])
115 env.Alias('install', ['bininstall', 'rlibinstall', 'maninstall'])
116
117 # vim: set syntax=python: