svn merge ^/trunk/blender -r55372:55392
[blender-staging.git] / SConstruct
1 #!/usr/bin/env python
2 #
3 # ***** BEGIN GPL LICENSE BLOCK *****
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
21 #
22 # The Original Code is: all of this file.
23 #
24 # Contributor(s): Nathan Letwory.
25 #
26 # ***** END GPL LICENSE BLOCK *****
27 #
28 # Main entry-point for the SCons building system
29 # Set up some custom actions and target/argument handling
30 # Then read all SConscripts and build
31 #
32 # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds.
33 # TODO: directory copy functions are far too complicated, see:
34 #       http://wiki.blender.org/index.php/User:Ideasman42/SConsNotSimpleInstallingFiles
35
36 import platform as pltfrm
37
38 # Need a better way to do this. Automagical maybe is not the best thing, maybe it is.
39 if pltfrm.architecture()[0] == '64bit':
40     bitness = 64
41 else:
42     bitness = 32
43
44 import sys
45 import os
46 import os.path
47 import string
48 import shutil
49 import glob
50 import re
51 from tempfile import mkdtemp
52
53 # store path to tools
54 toolpath=os.path.join(".", "build_files", "scons", "tools")
55
56 # needed for importing tools
57 sys.path.append(toolpath)
58
59 import Blender
60 import btools
61 import bcolors
62
63 EnsureSConsVersion(1,0,0)
64
65 # Before we do anything, let's check if we have a sane os.environ
66 if not btools.check_environ():
67     Exit()
68
69 BlenderEnvironment = Blender.BlenderEnvironment
70 B = Blender
71
72 VERSION = btools.VERSION # This is used in creating the local config directories
73 VERSION_RELEASE_CYCLE = btools.VERSION_RELEASE_CYCLE
74
75 ### globals ###
76 platform = sys.platform
77 quickie = None
78 quickdebug = None
79
80 ##### BEGIN SETUP #####
81
82 B.possible_types = ['core', 'player', 'player2', 'intern', 'extern']
83
84 B.binarykind = ['blender' , 'blenderplayer']
85 ##################################
86 # target and argument validation #
87 ##################################
88 # XX cheating for BF_FANCY, we check for BF_FANCY before args are validated
89 use_color = ARGUMENTS.get('BF_FANCY', '1')
90 if platform=='win32':
91     use_color = None
92
93 if not use_color=='1':
94     B.bc.disable()
95
96  #on defaut white Os X terminal, some colors are totally unlegible
97 if platform=='darwin':
98     B.bc.OKGREEN = '\033[34m'
99     B.bc.WARNING = '\033[36m'
100
101 # arguments
102 print B.bc.HEADER+'Command-line arguments'+B.bc.ENDC
103 B.arguments = btools.validate_arguments(ARGUMENTS, B.bc)
104 btools.print_arguments(B.arguments, B.bc)
105
106 # targets
107 print B.bc.HEADER+'Command-line targets'+B.bc.ENDC
108 B.targets = btools.validate_targets(COMMAND_LINE_TARGETS, B.bc)
109 btools.print_targets(B.targets, B.bc)
110
111 ##########################
112 # setting up environment #
113 ##########################
114
115 # handling cmd line arguments & config file
116
117 # bitness stuff
118 tempbitness = int(B.arguments.get('BF_BITNESS', bitness)) # default to bitness found as per starting python
119 if tempbitness in (32, 64): # only set if 32 or 64 has been given
120     bitness = int(tempbitness)
121
122 if bitness:
123     B.bitness = bitness
124 else: 
125     B.bitness = tempbitness
126
127
128 # first check cmdline for toolset and we create env to work on
129 quickie = B.arguments.get('BF_QUICK', None)
130 quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
131
132 if quickdebug:
133     B.quickdebug=string.split(quickdebug, ',')
134 else:
135     B.quickdebug=[]
136
137 if quickie:
138     B.quickie=string.split(quickie,',')
139 else:
140     B.quickie=[]
141
142 toolset = B.arguments.get('BF_TOOLSET', None)
143 if toolset:
144     print "Using " + toolset
145     if toolset=='mstoolkit':
146         env = BlenderEnvironment(ENV = os.environ)
147         env.Tool('mstoolkit', [toolpath])
148     else:
149         env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
150         if env:
151             btools.SetupSpawn(env)
152 else:
153     if bitness==64 and platform=='win32':
154         env = BlenderEnvironment(ENV = os.environ, MSVS_ARCH='amd64')
155     else:
156         env = BlenderEnvironment(ENV = os.environ)
157
158 if not env:
159     print "Could not create a build environment"
160     Exit()
161
162 cc = B.arguments.get('CC', None)
163 cxx = B.arguments.get('CXX', None)
164 if cc:
165     env['CC'] = cc
166 if cxx:
167     env['CXX'] = cxx
168
169 if sys.platform=='win32':
170     if env['CC'] in ['cl', 'cl.exe']:
171         platform = 'win64-vc' if bitness == 64 else 'win32-vc'
172     elif env['CC'] in ['gcc']:
173         platform = 'win64-mingw' if bitness == 64 else 'win32-mingw'
174
175 env.SConscriptChdir(0)
176
177 # Remove major kernel version from linux platform.
178 # After Linus switched kernel to new version model this major version
179 # shouldn't take much sense for building rules.
180
181 if re.match('linux[0-9]+', platform):
182     platform = 'linux'
183
184 crossbuild = B.arguments.get('BF_CROSS', None)
185 if crossbuild and platform not in ('win32-vc', 'win64-vc'):
186     platform = 'linuxcross'
187
188 env['OURPLATFORM'] = platform
189
190 configfile = os.path.join("build_files", "scons", "config", platform + "-config.py")
191
192 if os.path.exists(configfile):
193     print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
194 else:
195     print B.bc.FAIL + configfile + " doesn't exist" + B.bc.ENDC
196
197 if crossbuild and env['PLATFORM'] != 'win32':
198     print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC
199     env.Tool('crossmingw', [toolpath])
200     # todo: determine proper libs/includes etc.
201     # Needed for gui programs, console programs should do without it
202
203     # Now we don't need this option to have console window
204     # env.Append(LINKFLAGS=['-mwindows'])
205
206 userconfig = B.arguments.get('BF_CONFIG', 'user-config.py')
207 # first read platform config. B.arguments will override
208 optfiles = [configfile]
209 if os.path.exists(userconfig):
210     print B.bc.OKGREEN + "Using user-config file: " + B.bc.ENDC + userconfig
211     optfiles += [userconfig]
212 else:
213     print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
214
215 opts = btools.read_opts(env, optfiles, B.arguments)
216 opts.Update(env)
217
218 if sys.platform=='win32':
219     if bitness==64:
220         env.Append(CPPFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally
221
222 if not env['BF_FANCY']:
223     B.bc.disable()
224
225
226 # remove install dir so old and new files are not mixed.
227 # NOTE: only do the scripts directory for now, otherwise is too disruptive for developers
228 # TODO: perhaps we need an option (off by default) to not do this altogether...
229 if not env['WITHOUT_BF_INSTALL'] and not env['WITHOUT_BF_OVERWRITE_INSTALL']:
230     scriptsDir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts')
231     if os.path.isdir(scriptsDir):
232         print B.bc.OKGREEN + "Clearing installation directory%s: %s" % (B.bc.ENDC, os.path.abspath(scriptsDir))
233         shutil.rmtree(scriptsDir)
234
235
236 SetOption('num_jobs', int(env['BF_NUMJOBS']))
237 print B.bc.OKGREEN + "Build with parallel jobs%s: %s" % (B.bc.ENDC, GetOption('num_jobs'))
238 print B.bc.OKGREEN + "Build with debug symbols%s: %s" % (B.bc.ENDC, env['BF_DEBUG'])
239
240 if 'blenderlite' in B.targets:
241     target_env_defs = {}
242     target_env_defs['WITH_BF_GAMEENGINE'] = False
243     target_env_defs['WITH_BF_CYCLES'] = False
244     target_env_defs['WITH_BF_OPENAL'] = False
245     target_env_defs['WITH_BF_OPENEXR'] = False
246     target_env_defs['WITH_BF_OPENMP'] = False
247     target_env_defs['WITH_BF_ICONV'] = False
248     target_env_defs['WITH_BF_INTERNATIONAL'] = False
249     target_env_defs['WITH_BF_OPENJPEG'] = False
250     target_env_defs['WITH_BF_FFMPEG'] = False
251     target_env_defs['WITH_BF_QUICKTIME'] = False
252     target_env_defs['WITH_BF_REDCODE'] = False
253     target_env_defs['WITH_BF_DDS'] = False
254     target_env_defs['WITH_BF_CINEON'] = False
255     target_env_defs['WITH_BF_FRAMESERVER'] = False
256     target_env_defs['WITH_BF_HDR'] = False
257     target_env_defs['WITH_BF_ZLIB'] = False
258     target_env_defs['WITH_BF_SDL'] = False
259     target_env_defs['WITH_BF_JPEG'] = False
260     target_env_defs['WITH_BF_PNG'] = False
261     target_env_defs['WITH_BF_BULLET'] = False
262     target_env_defs['WITH_BF_BINRELOC'] = False
263     target_env_defs['BF_BUILDINFO'] = False
264     target_env_defs['WITH_BF_FLUID'] = False
265     target_env_defs['WITH_BF_OCEANSIM'] = False
266     target_env_defs['WITH_BF_SMOKE'] = False
267     target_env_defs['WITH_BF_BOOLEAN'] = False
268     target_env_defs['WITH_BF_REMESH'] = False
269     target_env_defs['WITH_BF_PYTHON'] = False
270     target_env_defs['WITH_BF_3DMOUSE'] = False
271     target_env_defs['WITH_BF_LIBMV'] = False
272     target_env_defs['WITH_BF_FREESTYLE'] = False
273
274     # Merge blenderlite, let command line to override
275     for k,v in target_env_defs.iteritems():
276         if k not in B.arguments:
277             env[k] = v
278
279 if 'cudakernels' in B.targets:
280     env['WITH_BF_CYCLES'] = True
281     env['WITH_BF_CYCLES_CUDA_BINARIES'] = True
282     env['WITH_BF_PYTHON'] = False
283
284 # Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY and JAckOSX detection for OSX
285 if env['OURPLATFORM']=='darwin':
286     print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'] + " --"
287     print "Available " + env['MACOSX_SDK_CHECK']
288     if not 'Mac OS X 10.6' in env['MACOSX_SDK_CHECK']:
289         print  B.bc.OKGREEN + "Auto-setting available MacOSX SDK -> " + B.bc.ENDC + "MacOSX10.7.sdk"
290     elif not 'Mac OS X 10.5' in env['MACOSX_SDK_CHECK']:
291         print  B.bc.OKGREEN + "Auto-setting available MacOSX SDK -> " + B.bc.ENDC + "MacOSX10.6.sdk"
292     else:
293         print B.bc.OKGREEN + "Found recommended sdk :" + B.bc.ENDC + " using MacOSX10.5.sdk"
294
295     # for now, Mac builders must download and install the 3DxWare 10 Beta 4 driver framework from 3Dconnexion
296     # necessary header file lives here when installed:
297     # /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h
298     if env['WITH_BF_3DMOUSE'] == 1:
299         if not os.path.exists('/Library/Frameworks/3DconnexionClient.framework'):
300             print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors !
301             env['WITH_BF_3DMOUSE'] = 0
302         else:
303             env.Append(LINKFLAGS=['-F/Library/Frameworks','-Xlinker','-weak_framework','-Xlinker','3DconnexionClient'])
304             env['BF_3DMOUSE_INC'] = '/Library/Frameworks/3DconnexionClient.framework/Headers'
305
306     # for now, Mac builders must download and install the JackOSX framework 
307     # necessary header file lives here when installed:
308     # /Library/Frameworks/Jackmp.framework/Versions/A/Headers/jack.h
309     if env['WITH_BF_JACK'] == 1:
310         if not os.path.exists('/Library/Frameworks/Jackmp.framework'):
311             print "JackOSX install not found, disabling WITH_BF_JACK" # avoid build errors !
312             env['WITH_BF_JACK'] = 0
313         else:
314             env.Append(LINKFLAGS=['-L/Library/Frameworks','-Xlinker','-weak_framework','-Xlinker','Jackmp'])
315
316     if env['WITH_BF_CYCLES_OSL'] == 1:  
317         OSX_OSL_LIBPATH = Dir(env.subst(env['BF_OSL_LIBPATH'])).abspath
318         # we need 2 variants of passing the oslexec with the force_load option, string and list type atm
319         env.Append(LINKFLAGS=['-L'+OSX_OSL_LIBPATH,'-loslcomp','-force_load '+ OSX_OSL_LIBPATH +'/liboslexec.a','-loslquery'])
320         env.Append(BF_PROGRAM_LINKFLAGS=['-Xlinker','-force_load','-Xlinker',OSX_OSL_LIBPATH +'/liboslexec.a'])
321
322     # Trying to get rid of eventually clashes, we export some explicite as local symbols                
323     env.Append(LINKFLAGS=['-Xlinker','-unexported_symbols_list','-Xlinker','./source/creator/osx_locals.map'])
324
325 if env['WITH_BF_OPENMP'] == 1:
326         if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
327                 env['CCFLAGS'].append('/openmp')
328         else:
329             if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case
330                 env.Append(LINKFLAGS=['-openmp', '-static-intel'])
331                 env['CCFLAGS'].append('-openmp')
332             else:
333                 env.Append(CCFLAGS=['-fopenmp']) 
334
335 if env['WITH_GHOST_COCOA'] == True:
336     env.Append(CPPFLAGS=['-DGHOST_COCOA']) 
337
338 if env['USE_QTKIT'] == True:
339     env.Append(CPPFLAGS=['-DUSE_QTKIT'])
340
341 #check for additional debug libnames
342
343 if env.has_key('BF_DEBUG_LIBS'):
344     B.quickdebug += env['BF_DEBUG_LIBS']
345
346 printdebug = B.arguments.get('BF_LISTDEBUG', 0)
347
348 if len(B.quickdebug) > 0 and printdebug != 0:
349     print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
350     for l in B.quickdebug:
351         print "\t" + l
352
353 # remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
354 if env['WITH_BF_STATICCXX']:
355     if 'stdc++' in env['LLIBS']:
356         env['LLIBS'].remove('stdc++')
357     else:
358         print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
359
360 # check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
361 if 'blenderplayer' in B.targets:
362     env['WITH_BF_PLAYER'] = True
363
364 if 'blendernogame' in B.targets:
365     env['WITH_BF_GAMEENGINE'] = False
366
367 # build without elbeem (fluidsim)?
368 if env['WITH_BF_FLUID'] == 1:
369     env['CPPFLAGS'].append('-DWITH_MOD_FLUID')
370
371 # build with ocean sim?
372 if env['WITH_BF_OCEANSIM'] == 1:
373     env['WITH_BF_FFTW3']  = 1  # ocean needs fftw3 so enable it 
374     env['CPPFLAGS'].append('-DWITH_MOD_OCEANSIM')
375
376
377 if btools.ENDIAN == "big":
378     env['CPPFLAGS'].append('-D__BIG_ENDIAN__')
379 else:
380     env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
381
382 # TODO, make optional (as with CMake)
383 env['CPPFLAGS'].append('-DWITH_AUDASPACE')
384 env['CPPFLAGS'].append('-DWITH_AVI')
385 env['CPPFLAGS'].append('-DWITH_BOOL_COMPAT')
386
387 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
388 B.root_build_dir = env['BF_BUILDDIR']
389 B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
390 if not B.root_build_dir[-1]==os.sep:
391     B.root_build_dir += os.sep
392 if not B.doc_build_dir[-1]==os.sep:
393     B.doc_build_dir += os.sep
394
395 # We do a shortcut for clean when no quicklist is given: just delete
396 # builddir without reading in SConscripts
397 do_clean = None
398 if 'clean' in B.targets:
399     do_clean = True
400
401 if not quickie and do_clean:
402     if os.path.exists(B.doc_build_dir):
403         print B.bc.HEADER+'Cleaning doc dir...'+B.bc.ENDC
404         dirs = os.listdir(B.doc_build_dir)
405         for entry in dirs:
406             if os.path.isdir(B.doc_build_dir + entry) == 1:
407                 print "clean dir %s"%(B.doc_build_dir+entry)
408                 shutil.rmtree(B.doc_build_dir+entry)
409             else: # remove file
410                 print "remove file %s"%(B.doc_build_dir+entry)
411                 os.remove(B.root_build_dir+entry)
412     if os.path.exists(B.root_build_dir):
413         print B.bc.HEADER+'Cleaning build dir...'+B.bc.ENDC
414         dirs = os.listdir(B.root_build_dir)
415         for entry in dirs:
416             if os.path.isdir(B.root_build_dir + entry) == 1:
417                 print "clean dir %s"%(B.root_build_dir+entry)
418                 shutil.rmtree(B.root_build_dir+entry)
419             else: # remove file
420                 print "remove file %s"%(B.root_build_dir+entry)
421                 os.remove(B.root_build_dir+entry)
422         for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
423                 'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
424             if os.path.exists(confile):
425                 print "clean file %s"%confile
426                 if os.path.isdir(confile):
427                     for root, dirs, files in os.walk(confile):
428                         for name in files:
429                             os.remove(os.path.join(root, name))
430                 else:
431                     os.remove(confile)
432         print B.bc.OKGREEN+'...done'+B.bc.ENDC
433     else:
434         print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
435     Exit()
436
437
438 # ensure python header is found since detection can fail, this could happen
439 # with _any_ library but since we used a fixed python version this tends to
440 # be most problematic.
441 if env['WITH_BF_PYTHON']:
442     found_python_h = found_pyconfig_h = False
443     for bf_python_inc in env.subst('${BF_PYTHON_INC}').split():
444         py_h = os.path.join(Dir(bf_python_inc).abspath, "Python.h")
445         if os.path.exists(py_h):
446             found_python_h = True
447         py_h = os.path.join(Dir(bf_python_inc).abspath, "pyconfig.h")
448         if os.path.exists(py_h):
449             found_pyconfig_h = True
450
451     if not (found_python_h and found_pyconfig_h):
452         print("""\nMissing: Python.h and/or pyconfig.h in "%s"
453          Set 'BF_PYTHON_INC' to point to valid include path(s),
454          containing Python.h and pyconfig.h for Python version "%s".
455
456          Example: python scons/scons.py BF_PYTHON_INC=../Python/include
457               """ % (env.subst('${BF_PYTHON_INC}'), env.subst('${BF_PYTHON_VERSION}')))
458         Exit()
459
460
461 if not os.path.isdir ( B.root_build_dir):
462     os.makedirs ( B.root_build_dir )
463     os.makedirs ( B.root_build_dir + 'source' )
464     os.makedirs ( B.root_build_dir + 'intern' )
465     os.makedirs ( B.root_build_dir + 'extern' )
466     os.makedirs ( B.root_build_dir + 'lib' )
467     os.makedirs ( B.root_build_dir + 'bin' )
468 # # Docs not working with epy anymore
469 # if not os.path.isdir(B.doc_build_dir) and env['WITH_BF_DOCS']:
470 #     os.makedirs ( B.doc_build_dir )
471
472 ###################################
473 # Ensure all data files are valid #
474 ###################################
475 if not os.path.isdir ( B.root_build_dir + 'data_headers'):
476     os.makedirs ( B.root_build_dir + 'data_headers' )
477 if not os.path.isdir ( B.root_build_dir + 'data_sources'):
478     os.makedirs ( B.root_build_dir + 'data_sources' )
479 # use for includes
480 env['DATA_HEADERS'] = os.path.join(os.path.abspath(env['BF_BUILDDIR']), "data_headers")
481 env['DATA_SOURCES'] = os.path.join(os.path.abspath(env['BF_BUILDDIR']), "data_sources")
482 def data_to_c(FILE_FROM, FILE_TO, VAR_NAME):
483     if os.sep == "\\":
484         FILE_FROM = FILE_FROM.replace("/", "\\")
485         FILE_TO   = FILE_TO.replace("/", "\\")
486
487     # first check if we need to bother.
488     if os.path.exists(FILE_TO):
489         if os.path.getmtime(FILE_FROM) < os.path.getmtime(FILE_TO):
490             return
491
492     print(B.bc.HEADER + "Generating: " + B.bc.ENDC + "%r" % os.path.basename(FILE_TO))
493     fpin = open(FILE_FROM, "rb")
494     fpin.seek(0, os.SEEK_END)
495     size = fpin.tell()
496     fpin.seek(0)
497
498     fpout = open(FILE_TO, "w")
499     fpout.write("int  %s_size = %d;\n" % (VAR_NAME, size))
500     fpout.write("char %s[] = {\n" % VAR_NAME)
501
502     while size > 0:
503         size -= 1
504         if size % 32 == 31:
505             fpout.write("\n")
506
507         fpout.write("%3d," % ord(fpin.read(1)))
508     fpout.write("\n  0};\n\n")
509
510     fpin.close()
511     fpout.close()
512
513 def data_to_c_simple(FILE_FROM):
514         filename_only = os.path.basename(FILE_FROM)
515         FILE_TO = os.path.join(env['DATA_SOURCES'], filename_only + ".c")
516         VAR_NAME = "datatoc_" + filename_only.replace(".", "_")
517         
518         data_to_c(FILE_FROM, FILE_TO, VAR_NAME)
519         
520
521 if B.targets != ['cudakernels']:
522     data_to_c("source/blender/compositor/operations/COM_OpenCLKernels.cl",
523               B.root_build_dir + "data_headers/COM_OpenCLKernels.cl.h",
524               "datatoc_COM_OpenCLKernels_cl")
525
526     data_to_c_simple("release/datafiles/startup.blend")
527     data_to_c_simple("release/datafiles/preview.blend")
528     data_to_c_simple("release/datafiles/preview_cycles.blend")
529
530     # --- glsl ---
531     data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_frag.glsl")
532     data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_vert.glsl")
533     data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
534     data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
535     data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl")
536     data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl")
537     data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl")
538     data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
539     data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
540
541     # --- blender ---
542     data_to_c_simple("release/datafiles/bfont.pfb")
543     data_to_c_simple("release/datafiles/bfont.ttf")
544     data_to_c_simple("release/datafiles/bmonofont.ttf")
545
546     data_to_c_simple("release/datafiles/splash.png")
547     data_to_c_simple("release/datafiles/blender_icons16.png")
548     data_to_c_simple("release/datafiles/blender_icons32.png")
549     data_to_c_simple("release/datafiles/prvicons.png")
550
551     data_to_c_simple("release/datafiles/brushicons/add.png")
552     data_to_c_simple("release/datafiles/brushicons/blob.png")
553     data_to_c_simple("release/datafiles/brushicons/blur.png")
554     data_to_c_simple("release/datafiles/brushicons/clay.png")
555     data_to_c_simple("release/datafiles/brushicons/claystrips.png")
556     data_to_c_simple("release/datafiles/brushicons/clone.png")
557     data_to_c_simple("release/datafiles/brushicons/crease.png")
558     data_to_c_simple("release/datafiles/brushicons/darken.png")
559     data_to_c_simple("release/datafiles/brushicons/draw.png")
560     data_to_c_simple("release/datafiles/brushicons/fill.png")
561     data_to_c_simple("release/datafiles/brushicons/flatten.png")
562     data_to_c_simple("release/datafiles/brushicons/grab.png")
563     data_to_c_simple("release/datafiles/brushicons/inflate.png")
564     data_to_c_simple("release/datafiles/brushicons/layer.png")
565     data_to_c_simple("release/datafiles/brushicons/lighten.png")
566     data_to_c_simple("release/datafiles/brushicons/mask.png")
567     data_to_c_simple("release/datafiles/brushicons/mix.png")
568     data_to_c_simple("release/datafiles/brushicons/multiply.png")
569     data_to_c_simple("release/datafiles/brushicons/nudge.png")
570     data_to_c_simple("release/datafiles/brushicons/pinch.png")
571     data_to_c_simple("release/datafiles/brushicons/scrape.png")
572     data_to_c_simple("release/datafiles/brushicons/smear.png")
573     data_to_c_simple("release/datafiles/brushicons/smooth.png")
574     data_to_c_simple("release/datafiles/brushicons/snake_hook.png")
575     data_to_c_simple("release/datafiles/brushicons/soften.png")
576     data_to_c_simple("release/datafiles/brushicons/subtract.png")
577     data_to_c_simple("release/datafiles/brushicons/texdraw.png")
578     data_to_c_simple("release/datafiles/brushicons/thumb.png")
579     data_to_c_simple("release/datafiles/brushicons/twist.png")
580     data_to_c_simple("release/datafiles/brushicons/vertexdraw.png")
581
582     data_to_c_simple("release/datafiles/matcaps/mc01.jpg")
583     data_to_c_simple("release/datafiles/matcaps/mc02.jpg")
584     data_to_c_simple("release/datafiles/matcaps/mc03.jpg")
585     data_to_c_simple("release/datafiles/matcaps/mc04.jpg")
586     data_to_c_simple("release/datafiles/matcaps/mc05.jpg")
587     data_to_c_simple("release/datafiles/matcaps/mc06.jpg")
588     data_to_c_simple("release/datafiles/matcaps/mc07.jpg")
589     data_to_c_simple("release/datafiles/matcaps/mc08.jpg")
590     data_to_c_simple("release/datafiles/matcaps/mc09.jpg")
591     data_to_c_simple("release/datafiles/matcaps/mc10.jpg")
592     data_to_c_simple("release/datafiles/matcaps/mc11.jpg")
593     data_to_c_simple("release/datafiles/matcaps/mc12.jpg")
594     data_to_c_simple("release/datafiles/matcaps/mc13.jpg")
595     data_to_c_simple("release/datafiles/matcaps/mc14.jpg")
596     data_to_c_simple("release/datafiles/matcaps/mc15.jpg")
597     data_to_c_simple("release/datafiles/matcaps/mc16.jpg")
598     data_to_c_simple("release/datafiles/matcaps/mc17.jpg")
599     data_to_c_simple("release/datafiles/matcaps/mc18.jpg")
600     data_to_c_simple("release/datafiles/matcaps/mc19.jpg")
601     data_to_c_simple("release/datafiles/matcaps/mc20.jpg")
602     data_to_c_simple("release/datafiles/matcaps/mc21.jpg")
603     data_to_c_simple("release/datafiles/matcaps/mc22.jpg")
604     data_to_c_simple("release/datafiles/matcaps/mc23.jpg")
605     data_to_c_simple("release/datafiles/matcaps/mc24.jpg")
606
607 ##### END DATAFILES ##########
608
609 Help(opts.GenerateHelpText(env))
610
611 # default is new quieter output, but if you need to see the
612 # commands, do 'scons BF_QUIET=0'
613 bf_quietoutput = B.arguments.get('BF_QUIET', '1')
614 if env['BF_QUIET']:
615     B.set_quiet_output(env)
616 else:
617     if toolset=='msvc':
618         B.msvc_hack(env)
619
620 print B.bc.HEADER+'Building in: ' + B.bc.ENDC + os.path.abspath(B.root_build_dir)
621 env.SConsignFile(B.root_build_dir+'scons-signatures')
622 B.init_lib_dict()
623
624 ##### END SETUP ##########
625
626 Export('env')
627
628 VariantDir(B.root_build_dir+'/source', 'source', duplicate=0)
629 SConscript(B.root_build_dir+'/source/SConscript')
630 VariantDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
631 SConscript(B.root_build_dir+'/intern/SConscript')
632 VariantDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
633 SConscript(B.root_build_dir+'/extern/SConscript')
634
635 # now that we have read all SConscripts, we know what
636 # libraries will be built. Create list of
637 # libraries to give as objects to linking phase
638 mainlist = []
639 for tp in B.possible_types:
640     if (not tp == 'player') and (not tp == 'player2'):
641         mainlist += B.create_blender_liblist(env, tp)
642
643 if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
644     B.propose_priorities()
645
646 dobj = B.buildinfo(env, "dynamic") + B.resources
647 creob = B.creator(env)
648 thestatlibs, thelibincs = B.setup_staticlibs(env)
649 thesyslibs = B.setup_syslibs(env)
650
651 if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
652     env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
653 if env['WITH_BF_PLAYER']:
654     playerlist = B.create_blender_liblist(env, 'player')
655     playerlist += B.create_blender_liblist(env, 'player2')
656     playerlist += B.create_blender_liblist(env, 'intern')
657     playerlist += B.create_blender_liblist(env, 'extern')
658     env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
659
660 ##### Now define some targets
661
662
663 #------------ INSTALL
664
665 #-- binaries
666 blenderinstall = []
667 if  env['OURPLATFORM']=='darwin':
668     for prg in B.program_list:
669         bundle = '%s.app' % prg[0]
670         bundledir = os.path.dirname(bundle)
671         for dp, dn, df in os.walk(bundle):
672             if '.svn' in dn:
673                 dn.remove('.svn')
674             if '_svn' in dn:
675                 dn.remove('_svn')
676             dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
677             source=[dp+os.sep+f for f in df]
678             blenderinstall.append(env.Install(dir=dir,source=source))
679 else:
680     blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
681
682 #-- local path = config files in install dir: installdir\VERSION
683 #- dont do config and scripts for darwin, it is already in the bundle
684 dotblendlist = []
685 datafileslist = []
686 datafilestargetlist = []
687 dottargetlist = []
688 scriptinstall = []
689 cubininstall = []
690
691 if env['OURPLATFORM']!='darwin':
692     dotblenderinstall = []
693     for targetdir,srcfile in zip(dottargetlist, dotblendlist):
694         td, tf = os.path.split(targetdir)
695         dotblenderinstall.append(env.Install(dir=td, source=srcfile))
696     for targetdir,srcfile in zip(datafilestargetlist, datafileslist):
697         td, tf = os.path.split(targetdir)
698         dotblenderinstall.append(env.Install(dir=td, source=srcfile))
699
700     if env['WITH_BF_PYTHON']:
701         #-- local/VERSION/scripts
702         scriptpaths=['release/scripts']
703         for scriptpath in scriptpaths:
704             for dp, dn, df in os.walk(scriptpath):
705                 if '.svn' in dn:
706                     dn.remove('.svn')
707                 if '_svn' in dn:
708                     dn.remove('_svn')
709                 if '__pycache__' in dn:  # py3.2 cache dir
710                     dn.remove('__pycache__')
711
712                 # only for testing builds
713                 if VERSION_RELEASE_CYCLE == "release" and "addons_contrib" in dn:
714                     dn.remove('addons_contrib')
715
716                 # do not install freestyle if disabled
717                 if not env['WITH_BF_FREESTYLE'] and "freestyle" in dn:
718                     dn.remove("freestyle")
719
720                 dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
721                 dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
722
723                 source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
724                 # To ensure empty dirs are created too
725                 if len(source)==0 and not os.path.exists(dir):
726                     env.Execute(Mkdir(dir))
727                 scriptinstall.append(env.Install(dir=dir,source=source))
728         if env['WITH_BF_CYCLES']:
729             # cycles python code
730             dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles')
731             source=os.listdir('intern/cycles/blender/addon')
732             if '.svn' in source: source.remove('.svn')
733             if '_svn' in source: source.remove('_svn')
734             if '__pycache__' in source: source.remove('__pycache__')
735             source=['intern/cycles/blender/addon/'+s for s in source]
736             scriptinstall.append(env.Install(dir=dir,source=source))
737
738             # cycles kernel code
739             dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel')
740             source=os.listdir('intern/cycles/kernel')
741             if '.svn' in source: source.remove('.svn')
742             if '_svn' in source: source.remove('_svn')
743             if '__pycache__' in source: source.remove('__pycache__')
744             source.remove('kernel.cpp')
745             source.remove('CMakeLists.txt')
746             source.remove('svm')
747             source.remove('closure')
748             source.remove('shaders')
749             source.remove('osl')
750             source=['intern/cycles/kernel/'+s for s in source]
751             source.append('intern/cycles/util/util_color.h')
752             source.append('intern/cycles/util/util_math.h')
753             source.append('intern/cycles/util/util_transform.h')
754             source.append('intern/cycles/util/util_types.h')
755             scriptinstall.append(env.Install(dir=dir,source=source))
756             # svm
757             dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel', 'svm')
758             source=os.listdir('intern/cycles/kernel/svm')
759             if '.svn' in source: source.remove('.svn')
760             if '_svn' in source: source.remove('_svn')
761             if '__pycache__' in source: source.remove('__pycache__')
762             source=['intern/cycles/kernel/svm/'+s for s in source]
763             scriptinstall.append(env.Install(dir=dir,source=source))
764             # closure
765             dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel', 'closure')
766             source=os.listdir('intern/cycles/kernel/closure')
767             if '.svn' in source: source.remove('.svn')
768             if '_svn' in source: source.remove('_svn')
769             if '__pycache__' in source: source.remove('__pycache__')
770             source=['intern/cycles/kernel/closure/'+s for s in source]
771             scriptinstall.append(env.Install(dir=dir,source=source))
772
773             # licenses
774             dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'license')
775             source=os.listdir('intern/cycles/doc/license')
776             if '.svn' in source: source.remove('.svn')
777             if '_svn' in source: source.remove('_svn')
778             if '__pycache__' in source: source.remove('__pycache__')
779             source.remove('CMakeLists.txt')
780             source=['intern/cycles/doc/license/'+s for s in source]
781             scriptinstall.append(env.Install(dir=dir,source=source))
782
783     if env['WITH_BF_CYCLES']:
784         # cuda binaries
785         if env['WITH_BF_CYCLES_CUDA_BINARIES']:
786             dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'lib')
787             for arch in env['BF_CYCLES_CUDA_BINARIES_ARCH']:
788                 kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel')
789                 cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch)
790                 cubininstall.append(env.Install(dir=dir,source=cubin_file))
791
792         # osl shaders
793         if env['WITH_BF_CYCLES_OSL']:
794             dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'shader')
795
796             osl_source_dir = Dir('./intern/cycles/kernel/shaders').srcnode().path
797             oso_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel/shaders')
798
799             headers='node_color.h node_fresnel.h node_texture.h oslutil.h stdosl.h'.split()
800             source=['intern/cycles/kernel/shaders/'+s for s in headers]
801             scriptinstall.append(env.Install(dir=dir,source=source))
802
803             for f in os.listdir(osl_source_dir):
804                 if f.endswith('.osl'):
805                     oso_file = os.path.join(oso_build_dir, f.replace('.osl', '.oso'))
806                     scriptinstall.append(env.Install(dir=dir,source=oso_file))
807
808     if env['WITH_BF_OCIO']:
809         colormanagement = os.path.join('release', 'datafiles', 'colormanagement')
810
811         for dp, dn, df in os.walk(colormanagement):
812             if '.svn' in dn:
813                 dn.remove('.svn')
814             if '_svn' in dn:
815                 dn.remove('_svn')
816
817             dir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'datafiles')
818             dir += os.sep + os.path.basename(colormanagement) + dp[len(colormanagement):]
819
820             source = [os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
821
822             # To ensure empty dirs are created too
823             if len(source) == 0:
824                 env.Execute(Mkdir(dir))
825
826             scriptinstall.append(env.Install(dir=dir,source=source))
827
828     if env['WITH_BF_INTERNATIONAL']:
829         internationalpaths=['release' + os.sep + 'datafiles']
830
831         def check_path(path, member):
832             return (member in path.split(os.sep))
833
834         for intpath in internationalpaths:
835             for dp, dn, df in os.walk(intpath):
836                 if '.svn' in dn:
837                     dn.remove('.svn')
838                 if '_svn' in dn:
839                     dn.remove('_svn')
840
841                 # we only care about release/datafiles/fonts, release/datafiles/locales
842                 if check_path(dp, "fonts") or check_path(dp, "locale"):
843                     pass
844                 else:
845                     continue
846
847                 dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
848                 dir += os.sep + os.path.basename(intpath) + dp[len(intpath):]
849
850                 source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
851                 # To ensure empty dirs are created too
852                 if len(source)==0:
853                     env.Execute(Mkdir(dir))
854                 scriptinstall.append(env.Install(dir=dir,source=source))
855
856 #-- icons
857 if env['OURPLATFORM']=='linux':
858     iconlist = []
859     icontargetlist = []
860
861     for tp, tn, tf in os.walk('release/freedesktop/icons'):
862         if '.svn' in tn:
863             tn.remove('.svn')
864         if '_svn' in tn:
865             tn.remove('_svn')
866         for f in tf:
867             iconlist.append(os.path.join(tp, f))
868             icontargetlist.append( os.path.join(*([env['BF_INSTALLDIR']] + tp.split(os.sep)[2:] + [f])) )
869
870     iconinstall = []
871     for targetdir,srcfile in zip(icontargetlist, iconlist):
872         td, tf = os.path.split(targetdir)
873         iconinstall.append(env.Install(dir=td, source=srcfile))
874
875     scriptinstall.append(env.Install(dir=env['BF_INSTALLDIR'], source='release/bin/blender-thumbnailer.py'))
876
877 # dlls for linuxcross
878 # TODO - add more libs, for now this lets blenderlite run
879 if env['OURPLATFORM']=='linuxcross':
880     dir=env['BF_INSTALLDIR']
881     source = []
882
883     if env['WITH_BF_OPENMP']:
884         source += ['../lib/windows/pthreads/lib/pthreadGC2.dll']
885
886     scriptinstall.append(env.Install(dir=dir, source=source))
887
888 textlist = []
889 texttargetlist = []
890 for tp, tn, tf in os.walk('release/text'):
891     if '.svn' in tn:
892         tn.remove('.svn')
893     if '_svn' in tn:
894         tn.remove('_svn')
895     for f in tf:
896         textlist.append(tp+os.sep+f)
897
898 textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
899
900 if  env['OURPLATFORM']=='darwin':
901         allinstall = [blenderinstall, textinstall]
902 elif env['OURPLATFORM']=='linux':
903         allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, iconinstall, cubininstall]
904 else:
905         allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, cubininstall]
906
907 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
908     dllsources = []
909
910     dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
911     # Used when linking to libtiff was dynamic
912     # keep it here until compilation on all platform would be ok
913     # dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
914
915     if env['OURPLATFORM'] != 'linuxcross':
916         # pthreads library is already added
917         dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
918
919     if env['WITH_BF_SDL']:
920         if env['OURPLATFORM'] == 'win64-vc':
921             pass # we link statically already to SDL on win64
922         else:
923             dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
924
925     if env['WITH_BF_PYTHON']:
926         if env['BF_DEBUG']:
927             dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
928         else:
929             dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
930
931     if env['WITH_BF_ICONV']:
932         if env['OURPLATFORM'] == 'win64-vc':
933             pass # we link statically to iconv on win64
934         elif not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
935             #gettext for MinGW and cross-compilation is compiled staticly
936             dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
937
938     if env['WITH_BF_OPENAL']:
939         dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
940         dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
941
942     if env['WITH_BF_SNDFILE']:
943         dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
944
945     if env['WITH_BF_FFMPEG']:
946         dllsources += env['BF_FFMPEG_DLL'].split()
947
948     # Since the thumb handler is loaded by Explorer, architecture is
949     # strict: the x86 build fails on x64 Windows. We need to ship
950     # both builds in x86 packages.
951     if bitness == 32:
952         dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb.dll')
953     dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
954
955     if env['WITH_BF_OCIO']:
956         if not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
957             dllsources.append('${LCGDIR}/opencolorio/bin/OpenColorIO.dll')
958
959         else:
960             dllsources.append('${LCGDIR}/opencolorio/bin/libOpenColorIO.dll')
961                         
962     dllsources.append('#source/icons/blender.exe.manifest')
963
964     windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
965     allinstall += windlls
966
967 if env['OURPLATFORM'] == 'win64-mingw':
968     dllsources = []
969
970     if env['WITH_BF_PYTHON']:
971         if env['BF_DEBUG']:
972             dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
973         else:
974             dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
975
976     if env['WITH_BF_FFMPEG']:
977         dllsources += env['BF_FFMPEG_DLL'].split()
978
979     if env['WITH_BF_OPENAL']:
980         dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
981         dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
982
983     if env['WITH_BF_SNDFILE']:
984         dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
985
986     if env['WITH_BF_SDL']:
987         dllsources.append('${LCGDIR}/sdl/lib/SDL.dll')
988
989     if(env['WITH_BF_OPENMP']):
990         dllsources.append('${LCGDIR}/binaries/libgomp-1.dll')
991                 
992     if env['WITH_BF_OCIO']:
993         dllsources.append('${LCGDIR}/opencolorio/bin/libOpenColorIO.dll')
994
995     dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
996     dllsources.append('${LCGDIR}/binaries/libgcc_s_sjlj-1.dll')
997     dllsources.append('${LCGDIR}/binaries/libwinpthread-1.dll')
998     dllsources.append('${LCGDIR}/binaries/libstdc++-6.dll')
999     dllsources.append('#source/icons/blender.exe.manifest')
1000
1001     windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
1002     allinstall += windlls
1003
1004 installtarget = env.Alias('install', allinstall)
1005 bininstalltarget = env.Alias('install-bin', blenderinstall)
1006
1007 nsisaction = env.Action(btools.NSIS_Installer, btools.NSIS_print)
1008 nsiscmd = env.Command('nsisinstaller', None, nsisaction)
1009 nsisalias = env.Alias('nsis', nsiscmd)
1010
1011 if 'blender' in B.targets:
1012     blenderexe= env.Alias('blender', B.program_list)
1013     Depends(blenderexe,installtarget)
1014
1015 if env['WITH_BF_PLAYER']:
1016     blenderplayer = env.Alias('blenderplayer', B.program_list)
1017     Depends(blenderplayer,installtarget)
1018
1019 if not env['WITH_BF_GAMEENGINE']:
1020     blendernogame = env.Alias('blendernogame', B.program_list)
1021     Depends(blendernogame,installtarget)
1022
1023 if 'blenderlite' in B.targets:
1024     blenderlite = env.Alias('blenderlite', B.program_list)
1025     Depends(blenderlite,installtarget)
1026
1027 Depends(nsiscmd, allinstall)
1028
1029 buildslave_action = env.Action(btools.buildslave, btools.buildslave_print)
1030 buildslave_cmd = env.Command('buildslave_exec', None, buildslave_action)
1031 buildslave_alias = env.Alias('buildslave', buildslave_cmd)
1032
1033 Depends(buildslave_cmd, allinstall)
1034
1035 cudakernels_action = env.Action(btools.cudakernels, btools.cudakernels_print)
1036 cudakernels_cmd = env.Command('cudakernels_exec', None, cudakernels_action)
1037 cudakernels_alias = env.Alias('cudakernels', cudakernels_cmd)
1038
1039 cudakernel_dir = os.path.join(os.path.abspath(os.path.normpath(B.root_build_dir)), 'intern/cycles/kernel')
1040 cuda_kernels = []
1041
1042 for x in env['BF_CYCLES_CUDA_BINARIES_ARCH']:
1043     cubin = os.path.join(cudakernel_dir, 'kernel_' + x + '.cubin')
1044     cuda_kernels.append(cubin)
1045
1046 Depends(cudakernels_cmd, cuda_kernels)
1047 Depends(cudakernels_cmd, cubininstall)
1048
1049 Default(B.program_list)
1050
1051 if not env['WITHOUT_BF_INSTALL']:
1052         Default(installtarget)
1053