Fix #30110: Outliner view: restriction icons not updating when toggling from Groups...
[blender.git] / SConstruct
index 0db32365bfcfa214ddc98084fa4e961ca5d8ef71..0dd59add019121803da410849541c73d8a0baf7b 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# $Id: SConstruct 41169 2011-10-21 04:23:26Z campbellbarton $
+#
 # ***** BEGIN GPL LICENSE BLOCK *****
 #
 # This program is free software; you can redistribute it and/or
@@ -30,6 +30,8 @@
 # Then read all SConscripts and build
 #
 # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds.
+# TODO: directory copy functions are far too complicated, see:
+#       http://wiki.blender.org/index.php/User:Ideasman42/SConsNotSimpleInstallingFiles
 
 import platform as pltfrm
 
@@ -68,6 +70,7 @@ BlenderEnvironment = Blender.BlenderEnvironment
 B = Blender
 
 VERSION = btools.VERSION # This is used in creating the local config directories
+VERSION_RELEASE_CYCLE = btools.VERSION_RELEASE_CYCLE
 
 ### globals ###
 platform = sys.platform
@@ -116,6 +119,12 @@ tempbitness = int(B.arguments.get('BF_BITNESS', bitness)) # default to bitness f
 if tempbitness in (32, 64): # only set if 32 or 64 has been given
     bitness = int(tempbitness)
 
+if bitness:
+    B.bitness = bitness
+else: 
+    B.bitness = tempbitness
+    
+
 # first check cmdline for toolset and we create env to work on
 quickie = B.arguments.get('BF_QUICK', None)
 quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
@@ -138,9 +147,8 @@ if toolset:
         env.Tool('mstoolkit', [toolpath])
     else:
         env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
-        # xxx commented out, as was supressing warnings under mingw..
-        #if env:
-        #    btools.SetupSpawn(env)
+        if env:
+            btools.SetupSpawn(env)
 else:
     if bitness==64 and platform=='win32':
         env = BlenderEnvironment(ENV = os.environ, MSVS_ARCH='amd64')
@@ -160,7 +168,7 @@ if cxx:
 
 if sys.platform=='win32':
     if env['CC'] in ['cl', 'cl.exe']:
-         platform = 'win64-vc' if bitness == 64 else 'win32-vc'
+        platform = 'win64-vc' if bitness == 64 else 'win32-vc'
     elif env['CC'] in ['gcc']:
         platform = 'win32-mingw'
 
@@ -251,7 +259,11 @@ if 'blenderlite' in B.targets:
     target_env_defs['WITH_BF_BULLET'] = False
     target_env_defs['WITH_BF_BINRELOC'] = False
     target_env_defs['BF_BUILDINFO'] = False
-    target_env_defs['BF_NO_ELBEEM'] = True
+    target_env_defs['WITH_BF_FLUID'] = False
+    target_env_defs['WITH_BF_OCEANSIM'] = False
+    target_env_defs['WITH_BF_DECIMATE'] = False
+    target_env_defs['WITH_BF_BOOLEAN'] = False
+    target_env_defs['WITH_BF_REMESH'] = False
     target_env_defs['WITH_BF_PYTHON'] = False
     target_env_defs['WITH_BF_3DMOUSE'] = False
     
@@ -260,7 +272,7 @@ if 'blenderlite' in B.targets:
         if k not in B.arguments:
             env[k] = v
 
-# Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY detection for OSX
+# Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY and JAckOSX detection for OSX
 if env['OURPLATFORM']=='darwin':
     print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'][:9] + " --"
     print "Available " + env['MACOSX_SDK_CHECK']
@@ -279,6 +291,16 @@ if env['OURPLATFORM']=='darwin':
         else:
             env.Append(LINKFLAGS=['-Xlinker','-weak_framework','-Xlinker','3DconnexionClient'])
 
+    # for now, Mac builders must download and install the JackOSX framework 
+    # necessary header file lives here when installed:
+    # /Library/Frameworks/Jackmp.framework/Versions/A/Headers/jack.h
+    if env['WITH_BF_JACK'] == 1:
+        if not os.path.exists('/Library/Frameworks/Jackmp.framework'):
+            print "JackOSX install not found, disabling WITH_BF_JACK" # avoid build errors !
+            env['WITH_BF_JACK'] = 0
+        else:
+            env.Append(LINKFLAGS=['-Xlinker','-weak_framework','-Xlinker','Jackmp'])
+
 if env['WITH_BF_OPENMP'] == 1:
         if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
                 env['CCFLAGS'].append('/openmp')
@@ -321,9 +343,14 @@ if 'blenderplayer' in B.targets:
 if 'blendernogame' in B.targets:
     env['WITH_BF_GAMEENGINE'] = False
 
-# disable elbeem (fluidsim) compilation?
-if env['BF_NO_ELBEEM'] == 1:
-    env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
+# build without elbeem (fluidsim)?
+if env['WITH_BF_FLUID'] == 1:
+    env['CPPFLAGS'].append('-DWITH_MOD_FLUID')
+
+# build with ocean sim?
+if env['WITH_BF_OCEANSIM'] == 1:
+    env['WITH_BF_FFTW3']  = 1  # ocean needs fftw3 so enable it 
+    env['CPPFLAGS'].append('-DWITH_MOD_OCEANSIM')
 
 
 if btools.ENDIAN == "big":
@@ -431,12 +458,12 @@ B.init_lib_dict()
 
 Export('env')
 
+BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
+SConscript(B.root_build_dir+'/source/SConscript')
 BuildDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
 SConscript(B.root_build_dir+'/intern/SConscript')
 BuildDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
 SConscript(B.root_build_dir+'/extern/SConscript')
-BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
-SConscript(B.root_build_dir+'/source/SConscript')
 
 # now that we have read all SConscripts, we know what
 # libraries will be built. Create list of
@@ -514,6 +541,10 @@ if env['OURPLATFORM']!='darwin':
                 if '__pycache__' in dn:  # py3.2 cache dir
                     dn.remove('__pycache__')
 
+                # only for testing builds
+                if VERSION_RELEASE_CYCLE == "release" and "addons_contrib" in dn:
+                    dn.remove('addons_contrib')
+
                 dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
                 dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
 
@@ -522,6 +553,58 @@ if env['OURPLATFORM']!='darwin':
                 if len(source)==0:
                     env.Execute(Mkdir(dir))
                 scriptinstall.append(env.Install(dir=dir,source=source))
+        if env['WITH_BF_CYCLES']:
+            # cycles python code
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles')
+            source=os.listdir('intern/cycles/blender/addon')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source=['intern/cycles/blender/addon/'+s for s in source]
+            scriptinstall.append(env.Install(dir=dir,source=source))
+
+            # cycles kernel code
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel')
+            source=os.listdir('intern/cycles/kernel')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source.remove('kernel.cpp')
+            source.remove('CMakeLists.txt')
+            source.remove('svm')
+            source.remove('osl')
+            source=['intern/cycles/kernel/'+s for s in source]
+            source.append('intern/cycles/util/util_color.h')
+            source.append('intern/cycles/util/util_math.h')
+            source.append('intern/cycles/util/util_transform.h')
+            source.append('intern/cycles/util/util_types.h')
+            scriptinstall.append(env.Install(dir=dir,source=source))
+            # svm
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel', 'svm')
+            source=os.listdir('intern/cycles/kernel/svm')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source=['intern/cycles/kernel/svm/'+s for s in source]
+            scriptinstall.append(env.Install(dir=dir,source=source))
+
+            # licenses
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'license')
+            source=os.listdir('intern/cycles/doc/license')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source.remove('CMakeLists.txt')
+            source=['intern/cycles/doc/license/'+s for s in source]
+            scriptinstall.append(env.Install(dir=dir,source=source))
+
+            # cuda binaries
+            if env['WITH_BF_CYCLES_CUDA_BINARIES']:
+                dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'lib')
+                for arch in env['BF_CYCLES_CUDA_BINARIES_ARCH']:
+                    kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel')
+                    cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch)
+                    scriptinstall.append(env.Install(dir=dir,source=cubin_file))
     
     if env['WITH_BF_INTERNATIONAL']:
         internationalpaths=['release' + os.sep + 'datafiles']
@@ -643,10 +726,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
         # For MinGW and linuxcross static linking will be used
         dllsources += ['${LCGDIR}/gettext/lib/gnu_gettext.dll']
 
-    #currently win64-vc doesn't appear to have libpng.dll
-    if env['OURPLATFORM'] != 'win64-vc':
-        dllsources += ['${BF_PNG_LIBPATH}/libpng.dll']
-
     dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
     # Used when linking to libtiff was dynamic
     # keep it here until compilation on all platform would be ok
@@ -677,7 +756,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
 
     if env['WITH_BF_OPENAL']:
         dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
-        dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
 
     if env['WITH_BF_SNDFILE']:
         dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
@@ -692,6 +770,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
         dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb.dll') 
     dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
 
+    if env['WITH_BF_OIIO']:
+        dllsources.append('${LCGDIR}/openimageio/bin/OpenImageIO.dll')
+
     dllsources.append('#source/icons/blender.exe.manifest')
 
     windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)