Help("""
Targets:
all - build everything,
libs - build all libraries
demos - build all demos
models - download/prepare all models
docs - compile doxygen documentation
libs = (static-lib, python-module)
static-lib - ray tracer library to link with
python-module - ray tracer module for Python
demos = (python-demos, cc-demos)
python-demos - Python demos, this depends on python-module
cc-demos - C++ demos
models = (local-models, download-models)
local-models - prepare local models
download-models - download models which are not locally available
no-docs = (libs, demos, models)
- everything but docs
no-download = (libs, demos, local-models)
- everything but docs and downloadable models
Default target is no-download.
""")
Decider('MD5-timestamp')
import os
env = Environment(ENV = {'PATH' : os.environ['PATH']})
### GNU C++ Compiler
#env.Replace(CXX="g++")
#env.Append(CCFLAGS="-O3 -Wall -pipe -ffast-math -msse3 ")
### Intel C++ Compiler
env.Replace(CXX="icpc")
env.Append(CCFLAGS="-O3 -w1 -mtune=core2 -xT ")
### MinGW32
# PY_CCFLAGS=-I"C:\Program Files\Python25\include"
# PY_LDFLAGS=-L"C:\Program Files\Python25\libs" -lpython25
# pthread
if env['PLATFORM'] == 'win32':
env.Append(LINKFLAGS="-lpthreadGC2 ")
else:
env.Append(CCFLAGS="-pthread ")
# CCFLAGS=-g -fno-strict-aliasing
# float: -fsingle-precision-constant
# double: -DPYRIT_DOUBLE
(lib, pymodule) = SConscript('src/SConscript', build_dir='build/lib', duplicate=0, exports='env')
SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='env lib')
SConscript('demos/SConscript', exports='pymodule')
env.Alias('demos', ['cc-demos', 'python-demos'])
SConscript('models/SConscript')
env.Alias('docs', Command('docs/html', [], 'doxygen'))
env.Clean('docs', ['docs/html', 'docs/latex'])
env.Alias('no-docs', ['libs', 'demos', 'models'])
env.Alias('no-download', ['libs', 'demos', 'local-models'])
env.Alias('all', ['no-docs', 'docs'])
env.Alias('pyrit', 'no-download')
Default('pyrit')