2010-08-10 01:38:37 +08:00
|
|
|
import SCons
|
|
|
|
import sys
|
|
|
|
import glob
|
|
|
|
import os
|
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
resources = []
|
|
|
|
plugins = []
|
|
|
|
stubs = []
|
2010-08-10 01:38:37 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
Export('SCons', 'sys', 'os', 'glob', 'resources',
|
|
|
|
'plugins', 'stubs')
|
2010-08-10 01:38:37 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# Configure the build framework
|
2011-06-01 08:20:53 +08:00
|
|
|
env = SConscript('build/SConscript.configure')
|
2010-09-05 23:09:06 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
Export('env')
|
2010-08-10 01:38:37 +08:00
|
|
|
|
|
|
|
if sys.platform == 'win32':
|
2011-02-03 16:15:25 +08:00
|
|
|
# Set an application icon on Windows
|
|
|
|
resources += [ env.RES('data/windows/mitsuba_res.rc') ]
|
2010-08-10 01:38:37 +08:00
|
|
|
|
2011-06-01 08:20:53 +08:00
|
|
|
def build(scriptFile, exports = [], duplicate = 0):
|
|
|
|
dirname = '/'.join(os.path.dirname(scriptFile).split('/')[1:])
|
|
|
|
return SConscript(scriptFile, exports,
|
|
|
|
variant_dir=os.path.join(env['BUILDDIR'], dirname), duplicate=duplicate)
|
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# ===== Build the support libraries ====
|
2010-10-08 00:38:06 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# Core support library
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/libcore/SConscript')
|
2011-02-03 16:15:25 +08:00
|
|
|
# Rendering-related APIs
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/librender/SConscript')
|
2011-02-03 16:15:25 +08:00
|
|
|
# Hardware acceleration
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/libhw/SConscript')
|
2011-07-01 17:35:49 +08:00
|
|
|
# Bidirectional support library
|
|
|
|
build('src/libbidir/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# ===== Build the applications =====
|
2010-08-10 01:38:37 +08:00
|
|
|
env = env.Clone()
|
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# Build the command-line binaries
|
2011-06-01 08:20:53 +08:00
|
|
|
mainEnv = build('src/mitsuba/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# Build the COLLADA converter
|
2011-06-01 08:20:53 +08:00
|
|
|
converter_objects = build('src/converter/SConscript', ['mainEnv'])
|
2010-08-10 01:38:37 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# Build the Qt-based GUI binaries
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/qtgui/SConscript', ['mainEnv', 'converter_objects'], duplicate=True)
|
2010-08-10 01:38:37 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# ===== Build the plugins =====
|
2010-08-10 01:38:37 +08:00
|
|
|
|
|
|
|
env['SHLIBPREFIX']=''
|
2011-02-03 16:15:25 +08:00
|
|
|
Export('env')
|
2010-08-10 01:38:37 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# Utilities
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/utils/SConscript')
|
2011-02-03 16:15:25 +08:00
|
|
|
# Surface scattering models
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/bsdfs/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
# Phase functions
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/phase/SConscript')
|
2011-02-03 16:15:25 +08:00
|
|
|
# Intersection shapes
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/shapes/SConscript')
|
2011-02-03 16:15:25 +08:00
|
|
|
# Sample generators
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/samplers/SConscript')
|
2011-02-03 16:15:25 +08:00
|
|
|
# Reconstruction filters
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/rfilters/SConscript')
|
2011-02-03 16:15:25 +08:00
|
|
|
# Film implementations
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/films/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
# Cameras
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/cameras/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
# Participating media
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/medium/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
# Volumetric data sources
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/volume/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
# Sub-surface integrators
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/subsurface/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
# Texture types
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/textures/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
# Light sources
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/luminaires/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
# Integrators
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/integrators/SConscript')
|
2010-09-02 23:57:04 +08:00
|
|
|
# Testcases
|
2011-06-01 08:20:53 +08:00
|
|
|
build('src/tests/SConscript')
|
2010-08-10 01:38:37 +08:00
|
|
|
|
2011-02-03 16:15:25 +08:00
|
|
|
# ===== Move everything to its proper place =====
|
2011-06-01 08:20:53 +08:00
|
|
|
SConscript('build/SConscript.install')
|