updated the build system to support a dynamic 'dist' directory

metadata
Wenzel Jakob 2011-07-18 14:20:02 +02:00
parent 317e661612
commit bf94a4869e
18 changed files with 70 additions and 69 deletions

View File

@ -28,6 +28,7 @@ if (sys.platform == 'win32' or sys.platform == 'darwin') and not os.path.exists(
# Parse configuration options
vars = Variables(configFile)
vars.Add('BUILDDIR', 'Target directory for intermediate files')
vars.Add('DISTDIR', 'Target directory for the final build')
vars.Add('CXX', 'C++ compiler')
vars.Add('CC', 'C compiler')
vars.Add('CXXFLAGS', 'C++ flags')

View File

@ -15,43 +15,31 @@ def install(target, paths, prefix = None):
else:
installTargets += env.Install(target, prefix + '/' + path)
if not 'DISTDIR' in env:
print 'The \"DISTDIR\" variable is missing. Please update your configuration file!'
Exit(1)
distDir = env.GetBuildPath(env['DISTDIR'])
for file in os.listdir(env.GetBuildPath('#data/schema')):
if fnmatch.fnmatch(file, '*.xsl') or fnmatch.fnmatch(file, '*.xsd'):
installTargets += env.Install(os.path.join(distDir, 'data/schema'), '#data/schema/' + file)
for file in os.listdir(env.GetBuildPath('#data/ior')):
if fnmatch.fnmatch(file, '*.spd'):
installTargets += env.Install(os.path.join(distDir, 'data/ior'), '#data/ior/' + file)
if sys.platform == 'linux2':
try:
distDir = env.GetBuildPath('#dist')
os.mkdir(distDir)
os.mkdir(distDir+'/plugins')
except:
pass
for plugin in plugins:
installTargets += env.Install('#dist/plugins', plugin)
install('#dist', ['libcore/libmitsuba-core.so', 'libhw/libmitsuba-hw.so',
installTargets += env.Install(os.path.join(distDir, 'plugins'), plugin)
install(distDir, ['libcore/libmitsuba-core.so', 'libhw/libmitsuba-hw.so',
'librender/libmitsuba-render.so', 'libbidir/libmitsuba-bidir.so'])
install('#dist', ['mitsuba/mitsuba', 'mitsuba/mtssrv',
'mitsuba/mtsutil', 'qtgui/mtsgui'])
install(distDir, ['mitsuba/mitsuba', 'mitsuba/mtssrv', 'mitsuba/mtsutil', 'qtgui/mtsgui'])
if hasCollada:
install('#dist', ['converter/mtsimport'])
for file in os.listdir(env.GetBuildPath('#data/schema')):
if fnmatch.fnmatch(file, '*.xsl') or fnmatch.fnmatch(file, '*.xsd'):
installTargets += env.Install('#dist/data/schema', '#data/schema/' + file)
for file in os.listdir(env.GetBuildPath('#data/ior')):
if fnmatch.fnmatch(file, '*.spd'):
installTargets += env.Install('#dist/data/ior', '#data/ior/' + file)
install(distDir, ['converter/mtsimport'])
if sys.platform == 'win32':
try:
distDir = env.GetBuildPath('#dist')
os.mkdir(distDir)
os.mkdir(distDir+'/plugins')
except:
pass
for plugin in plugins:
if '.dll' in plugin.__str__():
installTargets += env.Install('#dist/plugins', plugin)
for file in os.listdir(env.GetBuildPath('#data/schema')):
if fnmatch.fnmatch(file, '*.xsl') or fnmatch.fnmatch(file, '*.xsd'):
installTargets += env.Install('#dist/data/schema', '#data/schema/' + file)
for file in os.listdir(env.GetBuildPath('#data/ior')):
if fnmatch.fnmatch(file, '*.spd'):
installTargets += env.Install('#dist/data/ior', '#data/ior/' + file)
installTargets += env.Install(os.path.join(distDir, 'plugins'), plugin)
if 'WIN64' in env['CXXFLAGS']:
dllprefix='#dependencies/windows/lib64'
@ -66,49 +54,44 @@ if sys.platform == 'win32':
raise Exception('Unknown compiler version!')
if hasCollada:
install('#dist', ['converter/mtsimport.exe'])
install('#dist', ['mitsuba/mitsuba.exe', 'mitsuba/mtssrv.exe', 'mitsuba/mtsutil.exe'])
install('#dist', ['libcore/libmitsuba-core.dll', 'libhw/libmitsuba-hw.dll',
install(distDir, ['converter/mtsimport.exe'])
install(distDir, ['mitsuba/mitsuba.exe', 'mitsuba/mtssrv.exe', 'mitsuba/mtsutil.exe'])
install(distDir, ['libcore/libmitsuba-core.dll', 'libhw/libmitsuba-hw.dll',
'librender/libmitsuba-render.dll', 'libbidir/libmitsuba-bidir.dll'])
install('#dist', ['Iex.dll', 'Half.dll','IlmThread.dll', 'Imath.dll','IlmImf.dll','zlib1.dll',
install(distDir, ['Iex.dll', 'Half.dll','IlmThread.dll', 'Imath.dll','IlmImf.dll','zlib1.dll',
'libpng13.dll', 'jpeg62.dll', 'pthreadVCE2.dll', 'xerces-c_3_0.dll', 'glew32mx.dll'],
prefix=dllprefix)
install('#dist', ['libcollada14dom23.dll', 'boost_system-%s-mt-1_44.dll' % compilerType,
install(distDir, ['libcollada14dom23.dll', 'boost_system-%s-mt-1_44.dll' % compilerType,
'boost_filesystem-%s-mt-1_44.dll' % compilerType], dllprefix + '/' + compilerType + '/')
if 'WIN64' in env['CXXFLAGS']:
installTargets += env.Install('#dist', '#dependencies/windows/bin/vcredist_2010_sp1_x64.exe')
installTargets += env.Install(distDir, '#dependencies/windows/bin/vcredist_2010_sp1_x64.exe')
else:
installTargets += env.Install('#dist', '#dependencies/windows/bin/vcredist_2010_sp1_x86.exe')
installTargets += env.Install('#dist', '#data/windows/README.txt')
installTargets += env.Install(distDir, '#dependencies/windows/bin/vcredist_2010_sp1_x86.exe')
installTargets += env.Install(distDir, '#data/windows/README.txt')
if 'REDIST_PATH' in env:
install('#dist', ['libmmd.dll', 'libiomp5md.dll'], prefix = env['REDIST_PATH'])
install(distDir, ['libmmd.dll', 'libiomp5md.dll'], prefix = env['REDIST_PATH'])
if hasQt:
install('#dist', ['qtgui/mtsgui.exe'])
install('#dist', ['QtCore4.dll', 'QtGui4.dll', 'QtXml4.dll',
install(distDir, ['qtgui/mtsgui.exe'])
install(distDir, ['QtCore4.dll', 'QtGui4.dll', 'QtXml4.dll',
'QtNetwork4.dll', 'QtOpenGL4.dll', 'QtXmlPatterns4.dll'], prefix = env['QT4_BINPATH'])
elif sys.platform == 'darwin':
for i in plugins:
installTargets += env.Install('#Mitsuba.app/plugins', i)
for file in os.listdir(env.GetBuildPath('#data/schema')):
if fnmatch.fnmatch(file, '*.xsl') or fnmatch.fnmatch(file, '*.xsd'):
installTargets += env.Install('#Mitsuba.app/data/schema', '#data/schema/' + file)
for file in os.listdir(env.GetBuildPath('#data/ior')):
if fnmatch.fnmatch(file, '*.spd'):
installTargets += env.Install('#Mitsuba.app/data/ior', '#data/ior/' + file)
install('#Mitsuba.app/Contents/MacOS', ['mitsuba/mitsuba', 'mitsuba/mtssrv', 'mitsuba/mtsutil'])
installTargets += env.Install(os.path.join(distDir, 'plugins'), i)
install(os.path.join(distDir, 'Contents/MacOS'), ['mitsuba/mitsuba', 'mitsuba/mtssrv', 'mitsuba/mtsutil'])
if hasCollada:
install('#Mitsuba.app/Contents/MacOS', ['converter/mtsimport'])
plist = env.Install('#Mitsuba.app/Contents', '#data/darwin/Info.plist')
install(os.path.join(distDir, 'Contents/MacOS'), ['converter/mtsimport'])
plist = env.Install(os.path.join(distDir, 'Contents'), '#data/darwin/Info.plist')
installTargets += plist
installTargets += env.AddPostAction(plist, 'perl -pi -e "s/MTS_VERSION/%s/" $TARGET' % MTS_VERSION)
installTargets += env.Install('#Mitsuba.app/Contents', '#data/darwin/PkgInfo')
installTargets += env.Install('#Mitsuba.app/Contents/Resources', '#data/darwin/Resources/mitsuba.icns')
installTargets += env.Install(os.path.join(distDir, 'Contents'), '#data/darwin/PkgInfo')
installTargets += env.Install(os.path.join(distDir, 'Contents/Resources'), '#data/darwin/Resources/mitsuba.icns')
frameworkDir = os.path.join(distDir, 'Contents/Frameworks')
install('#Mitsuba.app/Contents/Frameworks', ['libcore/libmitsuba-core.dylib', 'libhw/libmitsuba-hw.dylib',
install(frameworkDir, ['libcore/libmitsuba-core.dylib', 'libhw/libmitsuba-hw.dylib',
'librender/libmitsuba-render.dylib', 'libbidir/libmitsuba-bidir.dylib'])
install('#Mitsuba.app/Contents/Frameworks', [
install(frameworkDir, [
'GLEW.framework/Resources/libs/libGLEW.dylib', 'OpenEXR.framework/Resources/lib/libHalf.6.dylib',
'OpenEXR.framework/Resources/lib/libIex.6.dylib', 'OpenEXR.framework/Resources/lib/libImath.6.dylib',
'OpenEXR.framework/Resources/lib/libIlmThread.6.dylib', 'OpenEXR.framework/Resources/lib/libIlmImf.6.dylib',
@ -116,30 +99,31 @@ elif sys.platform == 'darwin':
'libjpeg.framework/Resources/lib/libjpeg.dylib', 'libboost.framework/Resources/lib/libboost_system.dylib',
'libboost.framework/Resources/lib/libboost_filesystem.dylib'], '#dependencies/darwin')
if hasCollada:
install('#Mitsuba.app/Contents/Frameworks', [
install(frameworkDir, [
'Collada14Dom.framework/Resources/lib/libCollada14Dom.dylib'], '#dependencies/darwin')
if hasQt:
install('#Mitsuba.app/Contents/MacOS', ['qtgui/mtsgui'])
installTargets += env.OSXLibInst('#Mitsuba.app/Contents/Frameworks', '/Library/Frameworks/QtCore.framework/Versions/4/QtCore')
opengl = env.OSXLibInst('#Mitsuba.app/Contents/Frameworks', '/Library/Frameworks/QtOpenGL.framework/Versions/4/QtOpenGL')
xml = env.OSXLibInst('#Mitsuba.app/Contents/Frameworks', '/Library/Frameworks/QtXml.framework/Versions/4/QtXml')
xmlpatterns = env.OSXLibInst('#Mitsuba.app/Contents/Frameworks', '/Library/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns')
network = env.OSXLibInst('#Mitsuba.app/Contents/Frameworks', '/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork')
gui = env.OSXLibInst('#Mitsuba.app/Contents/Frameworks', '/Library/Frameworks/QtGui.framework/Versions/4/QtGui')
install(os.path.join(distDir, 'Contents/MacOS'), ['qtgui/mtsgui'])
installTargets += env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtCore.framework/Versions/4/QtCore')
opengl = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtOpenGL.framework/Versions/4/QtOpenGL')
xml = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtXml.framework/Versions/4/QtXml')
xmlpatterns = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns')
network = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork')
gui = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtGui.framework/Versions/4/QtGui')
installTargets += env.AddPostAction(xml, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(xmlpatterns, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(network, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(gui, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(opengl, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(opengl, 'install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui $TARGET')
installTargets += env.Install('#Mitsuba.app/Contents/Resources', '/Library/Frameworks//QtGui.framework/Versions/4/Resources/qt_menu.nib')
installTargets += env.Install('#Mitsuba.app/Contents/Resources/PreviewSettings.nib', '#data/darwin/PreviewSettings.nib/designable.nib')
installTargets += env.Install('#Mitsuba.app/Contents/Resources/PreviewSettings.nib', '#data/darwin/PreviewSettings.nib/keyedobjects.nib')
installTargets += env.Install('#Mitsuba.app/Contents/Resources', '#data/darwin/qt.conf')
installTargets += env.Install('#Mitsuba.app/Contents/Frameworks/BWToolkitFramework.framework/Versions/A', '#dependencies/darwin/BWToolkitFramework.framework/Versions/A/BWToolkitFramework')
installTargets += env.Install(os.path.join(distDir, 'Contents/Resources'), '/Library/Frameworks//QtGui.framework/Versions/4/Resources/qt_menu.nib')
installTargets += env.Install(os.path.join(distDir, 'Contents/Resources/PreviewSettings.nib'), '#data/darwin/PreviewSettings.nib/designable.nib')
installTargets += env.Install(os.path.join(distDir, 'Contents/Resources/PreviewSettings.nib'), '#data/darwin/PreviewSettings.nib/keyedobjects.nib')
installTargets += env.Install(os.path.join(distDir, 'Contents/Resources'), '#data/darwin/qt.conf')
installTargets += env.Install(os.path.join(distDir, 'Contents/Frameworks/BWToolkitFramework.framework/Versions/A'),
'#dependencies/darwin/BWToolkitFramework.framework/Versions/A/BWToolkitFramework')
for file in os.listdir(env.GetBuildPath('#dependencies/darwin/BWToolkitFramework.framework/Versions/A/Resources')):
if fnmatch.fnmatch(file, '*.pdf') or fnmatch.fnmatch(file, '*.tiff') or fnmatch.fnmatch(file, '*.tif') or fnmatch.fnmatch(file, '*.png') or fnmatch.fnmatch(file, '*.rtf') or fnmatch.fnmatch(file, '*.plist'):
installTargets += env.Install('#Mitsuba.app/Contents/Frameworks/BWToolkitFramework.framework/Resources', '#dependencies/darwin/BWToolkitFramework.framework/Versions/A/Resources/' + file)
installTargets += env.Install(os.path.join(distDir, 'Contents/Frameworks/BWToolkitFramework.framework/Resources'), '#dependencies/darwin/BWToolkitFramework.framework/Versions/A/Resources/' + file)
if dist:
if sys.platform == 'win32':

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-arch', 'i386', '-arch', 'x86_64', '-mmacosx-version-min=10.5', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks']

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-arch', 'i386', '-mmacosx-version-min=10.5', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks']

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-arch', 'x86_64', '-mmacosx-version-min=10.5', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks']

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'icl'
CC = 'icl'
LINK = 'xilink'

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'icl'
CC = 'icl'
LINK = 'xilink'

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-O0', '-Wall', '-g', '-pipe', '-march=nocona', '-msse2', '-ftree-vectorize', '-mfpmath=sse', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp']

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-O3', '-Wall', '-g', '-pipe', '-march=nocona', '-msse2', '-ftree-vectorize', '-mfpmath=sse', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp']

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission

View File

@ -1,4 +1,5 @@
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission

View File

@ -44,6 +44,7 @@ MTS_NAMESPACE_BEGIN
* <bsdf type="hk">
* <spectrum name="sigmaS" value="4"/>
* <spectrum name="sigmaA" value="0.1"/>
* <float name="thickness" value="0.5"/>
* <phase type="hg">
* <float name="g" value="0.98"/>
* </phase>