3 # ***** BEGIN GPL LICENSE BLOCK *****
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
22 # The Original Code is: all of this file.
24 # Contributor(s): Nathan Letwory.
26 # ***** END GPL LICENSE BLOCK *****
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
32 # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds.
34 import platform as pltfrm
36 # Need a better way to do this. Automagical maybe is not the best thing, maybe it is.
37 if pltfrm.architecture()[0] == '64bit':
49 from tempfile import mkdtemp
52 toolpath=os.path.join(".", "build_files", "scons", "tools")
54 # needed for importing tools
55 sys.path.append(toolpath)
61 EnsureSConsVersion(1,0,0)
63 # Before we do anything, let's check if we have a sane os.environ
64 if not btools.check_environ():
67 BlenderEnvironment = Blender.BlenderEnvironment
70 VERSION = btools.VERSION # This is used in creating the local config directories
73 platform = sys.platform
77 ##### BEGIN SETUP #####
79 B.possible_types = ['core', 'player', 'player2', 'intern', 'extern']
81 B.binarykind = ['blender' , 'blenderplayer']
82 ##################################
83 # target and argument validation #
84 ##################################
85 # XX cheating for BF_FANCY, we check for BF_FANCY before args are validated
86 use_color = ARGUMENTS.get('BF_FANCY', '1')
90 if not use_color=='1':
93 #on defaut white Os X terminal, some colors are totally unlegible
94 if platform=='darwin':
95 B.bc.OKGREEN = '\033[34m'
96 B.bc.WARNING = '\033[36m'
99 print B.bc.HEADER+'Command-line arguments'+B.bc.ENDC
100 B.arguments = btools.validate_arguments(ARGUMENTS, B.bc)
101 btools.print_arguments(B.arguments, B.bc)
104 print B.bc.HEADER+'Command-line targets'+B.bc.ENDC
105 B.targets = btools.validate_targets(COMMAND_LINE_TARGETS, B.bc)
106 btools.print_targets(B.targets, B.bc)
108 ##########################
109 # setting up environment #
110 ##########################
112 # handling cmd line arguments & config file
114 # first check cmdline for toolset and we create env to work on
115 quickie = B.arguments.get('BF_QUICK', None)
116 quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
119 B.quickdebug=string.split(quickdebug, ',')
124 B.quickie=string.split(quickie,',')
128 toolset = B.arguments.get('BF_TOOLSET', None)
130 print "Using " + toolset
131 if toolset=='mstoolkit':
132 env = BlenderEnvironment(ENV = os.environ)
133 env.Tool('mstoolkit', [toolpath])
135 env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
136 # xxx commented out, as was supressing warnings under mingw..
138 # btools.SetupSpawn(env)
140 if bitness==64 and platform=='win32':
141 env = BlenderEnvironment(ENV = os.environ, MSVS_ARCH='amd64')
143 env = BlenderEnvironment(ENV = os.environ)
146 print "Could not create a build environment"
149 cc = B.arguments.get('CC', None)
150 cxx = B.arguments.get('CXX', None)
156 if sys.platform=='win32':
157 if env['CC'] in ['cl', 'cl.exe']:
158 platform = 'win64-vc' if bitness == 64 else 'win32-vc'
159 elif env['CC'] in ['gcc']:
160 platform = 'win32-mingw'
162 env.SConscriptChdir(0)
164 crossbuild = B.arguments.get('BF_CROSS', None)
165 if crossbuild and platform not in ('win32-vc', 'win64-vc'):
166 platform = 'linuxcross'
168 env['OURPLATFORM'] = platform
170 configfile = os.path.join("build_files", "scons", "config", platform + "-config.py")
172 if os.path.exists(configfile):
173 print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
175 print B.bc.FAIL + configfile + " doesn't exist" + B.bc.ENDC
177 if crossbuild and env['PLATFORM'] != 'win32':
178 print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC
179 env.Tool('crossmingw', [toolpath])
180 # todo: determine proper libs/includes etc.
181 # Needed for gui programs, console programs should do without it
183 # Now we don't need this option to have console window
184 # env.Append(LINKFLAGS=['-mwindows'])
186 userconfig = B.arguments.get('BF_CONFIG', 'user-config.py')
187 # first read platform config. B.arguments will override
188 optfiles = [configfile]
189 if os.path.exists(userconfig):
190 print B.bc.OKGREEN + "Using user-config file: " + B.bc.ENDC + userconfig
191 optfiles += [userconfig]
193 print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
195 opts = btools.read_opts(env, optfiles, B.arguments)
198 if sys.platform=='win32':
200 env.Append(CFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally
202 if not env['BF_FANCY']:
206 # remove install dir so old and new files are not mixed.
207 # NOTE: only do the scripts directory for now, otherwise is too disruptive for developers
208 # TODO: perhaps we need an option (off by default) to not do this altogether...
209 if not env['WITHOUT_BF_INSTALL'] and not env['WITHOUT_BF_OVERWRITE_INSTALL']:
210 scriptsDir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts')
211 if os.path.isdir(scriptsDir):
212 print B.bc.OKGREEN + "Clearing installation directory%s: %s" % (B.bc.ENDC, os.path.abspath(scriptsDir))
213 shutil.rmtree(scriptsDir)
216 SetOption('num_jobs', int(env['BF_NUMJOBS']))
217 print B.bc.OKGREEN + "Build with parallel jobs%s: %s" % (B.bc.ENDC, GetOption('num_jobs'))
218 print B.bc.OKGREEN + "Build with debug symbols%s: %s" % (B.bc.ENDC, env['BF_DEBUG'])
220 if 'blenderlite' in B.targets:
222 target_env_defs['WITH_BF_GAMEENGINE'] = False
223 target_env_defs['WITH_BF_OPENAL'] = False
224 target_env_defs['WITH_BF_OPENEXR'] = False
225 target_env_defs['WITH_BF_OPENMP'] = False
226 target_env_defs['WITH_BF_ICONV'] = False
227 target_env_defs['WITH_BF_INTERNATIONAL'] = False
228 target_env_defs['WITH_BF_OPENJPEG'] = False
229 target_env_defs['WITH_BF_FFMPEG'] = False
230 target_env_defs['WITH_BF_QUICKTIME'] = False
231 target_env_defs['WITH_BF_REDCODE'] = False
232 target_env_defs['WITH_BF_DDS'] = False
233 target_env_defs['WITH_BF_CINEON'] = False
234 target_env_defs['WITH_BF_HDR'] = False
235 target_env_defs['WITH_BF_ZLIB'] = False
236 target_env_defs['WITH_BF_SDL'] = False
237 target_env_defs['WITH_BF_JPEG'] = False
238 target_env_defs['WITH_BF_PNG'] = False
239 target_env_defs['WITH_BF_BULLET'] = False
240 target_env_defs['WITH_BF_BINRELOC'] = False
241 target_env_defs['BF_BUILDINFO'] = False
242 target_env_defs['BF_NO_ELBEEM'] = True
243 target_env_defs['WITH_BF_PYTHON'] = False
245 # Merge blenderlite, let command line to override
246 for k,v in target_env_defs.iteritems():
247 if k not in B.arguments:
251 if env['WITH_BF_OPENMP'] == 1:
252 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
253 env['CCFLAGS'].append('/openmp')
254 env['CPPFLAGS'].append('/openmp')
255 env['CXXFLAGS'].append('/openmp')
257 if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case
258 env.Append(LINKFLAGS=['-openmp', '-static-intel'])
259 env['CCFLAGS'].append('-openmp')
260 env['CPPFLAGS'].append('-openmp')
261 env['CXXFLAGS'].append('-openmp')
263 env.Append(CCFLAGS=['-fopenmp'])
264 env.Append(CPPFLAGS=['-fopenmp'])
265 env.Append(CXXFLAGS=['-fopenmp'])
267 if env['WITH_GHOST_COCOA'] == True:
268 env.Append(CFLAGS=['-DGHOST_COCOA'])
269 env.Append(CXXFLAGS=['-DGHOST_COCOA'])
270 env.Append(CPPFLAGS=['-DGHOST_COCOA'])
272 if env['USE_QTKIT'] == True:
273 env.Append(CFLAGS=['-DUSE_QTKIT'])
274 env.Append(CXXFLAGS=['-DUSE_QTKIT'])
275 env.Append(CPPFLAGS=['-DUSE_QTKIT'])
277 #check for additional debug libnames
279 if env.has_key('BF_DEBUG_LIBS'):
280 B.quickdebug += env['BF_DEBUG_LIBS']
282 printdebug = B.arguments.get('BF_LISTDEBUG', 0)
284 if len(B.quickdebug) > 0 and printdebug != 0:
285 print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
286 for l in B.quickdebug:
289 # remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
290 if env['WITH_BF_STATICCXX']:
291 if 'stdc++' in env['LLIBS']:
292 env['LLIBS'].remove('stdc++')
294 print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
296 # check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
297 if 'blenderplayer' in B.targets:
298 env['WITH_BF_PLAYER'] = True
300 if 'blendernogame' in B.targets:
301 env['WITH_BF_GAMEENGINE'] = False
303 # disable elbeem (fluidsim) compilation?
304 if env['BF_NO_ELBEEM'] == 1:
305 env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
306 env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
307 env['CCFLAGS'].append('-DDISABLE_ELBEEM')
309 # TODO, make optional
310 env['CPPFLAGS'].append('-DWITH_AUDASPACE')
311 env['CXXFLAGS'].append('-DWITH_AUDASPACE')
312 env['CCFLAGS'].append('-DWITH_AUDASPACE')
314 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
315 B.root_build_dir = env['BF_BUILDDIR']
316 B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
317 if not B.root_build_dir[-1]==os.sep:
318 B.root_build_dir += os.sep
319 if not B.doc_build_dir[-1]==os.sep:
320 B.doc_build_dir += os.sep
322 # We do a shortcut for clean when no quicklist is given: just delete
323 # builddir without reading in SConscripts
325 if 'clean' in B.targets:
328 if not quickie and do_clean:
329 if os.path.exists(B.doc_build_dir):
330 print B.bc.HEADER+'Cleaning doc dir...'+B.bc.ENDC
331 dirs = os.listdir(B.doc_build_dir)
333 if os.path.isdir(B.doc_build_dir + entry) == 1:
334 print "clean dir %s"%(B.doc_build_dir+entry)
335 shutil.rmtree(B.doc_build_dir+entry)
337 print "remove file %s"%(B.doc_build_dir+entry)
338 os.remove(B.root_build_dir+entry)
339 if os.path.exists(B.root_build_dir):
340 print B.bc.HEADER+'Cleaning build dir...'+B.bc.ENDC
341 dirs = os.listdir(B.root_build_dir)
343 if os.path.isdir(B.root_build_dir + entry) == 1:
344 print "clean dir %s"%(B.root_build_dir+entry)
345 shutil.rmtree(B.root_build_dir+entry)
347 print "remove file %s"%(B.root_build_dir+entry)
348 os.remove(B.root_build_dir+entry)
349 for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
350 'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
351 if os.path.exists(confile):
352 print "clean file %s"%confile
353 if os.path.isdir(confile):
354 for root, dirs, files in os.walk(confile):
356 os.remove(os.path.join(root, name))
359 print B.bc.OKGREEN+'...done'+B.bc.ENDC
361 print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
364 if not os.path.isdir ( B.root_build_dir):
365 os.makedirs ( B.root_build_dir )
366 os.makedirs ( B.root_build_dir + 'source' )
367 os.makedirs ( B.root_build_dir + 'intern' )
368 os.makedirs ( B.root_build_dir + 'extern' )
369 os.makedirs ( B.root_build_dir + 'lib' )
370 os.makedirs ( B.root_build_dir + 'bin' )
371 # # Docs not working with epy anymore
372 # if not os.path.isdir(B.doc_build_dir) and env['WITH_BF_DOCS']:
373 # os.makedirs ( B.doc_build_dir )
375 Help(opts.GenerateHelpText(env))
377 # default is new quieter output, but if you need to see the
378 # commands, do 'scons BF_QUIET=0'
379 bf_quietoutput = B.arguments.get('BF_QUIET', '1')
381 B.set_quiet_output(env)
386 print B.bc.HEADER+'Building in: ' + B.bc.ENDC + os.path.abspath(B.root_build_dir)
387 env.SConsignFile(B.root_build_dir+'scons-signatures')
390 ##### END SETUP ##########
394 BuildDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
395 SConscript(B.root_build_dir+'/intern/SConscript')
396 BuildDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
397 SConscript(B.root_build_dir+'/extern/SConscript')
398 BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
399 SConscript(B.root_build_dir+'/source/SConscript')
401 # now that we have read all SConscripts, we know what
402 # libraries will be built. Create list of
403 # libraries to give as objects to linking phase
405 for tp in B.possible_types:
406 if (not tp == 'player') and (not tp == 'player2'):
407 mainlist += B.create_blender_liblist(env, tp)
409 if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
410 B.propose_priorities()
412 dobj = B.buildinfo(env, "dynamic") + B.resources
413 creob = B.creator(env)
414 thestatlibs, thelibincs = B.setup_staticlibs(env)
415 thesyslibs = B.setup_syslibs(env)
417 if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
418 env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
419 if env['WITH_BF_PLAYER']:
420 playerlist = B.create_blender_liblist(env, 'player')
421 playerlist += B.create_blender_liblist(env, 'player2')
422 playerlist += B.create_blender_liblist(env, 'intern')
423 playerlist += B.create_blender_liblist(env, 'extern')
424 env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
426 ##### Now define some targets
429 #------------ INSTALL
433 if env['OURPLATFORM']=='darwin':
434 for prg in B.program_list:
435 bundle = '%s.app' % prg[0]
436 bundledir = os.path.dirname(bundle)
437 for dp, dn, df in os.walk(bundle):
442 dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
443 source=[dp+os.sep+f for f in df]
444 blenderinstall.append(env.Install(dir=dir,source=source))
446 blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
448 #-- local path = config files in install dir: installdir\VERSION
449 #- dont do config and scripts for darwin, it is already in the bundle
452 datafilestargetlist = []
456 if env['OURPLATFORM']!='darwin':
457 for dp, dn, df in os.walk('bin/.blender'):
464 if not env['WITH_BF_INTERNATIONAL']:
467 if f == '.Blanguages':
469 if not env['WITH_BF_FREETYPE']:
470 if f.endswith('.ttf'):
474 datafileslist.append(os.path.join(dp,f))
475 dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:])) # skip bin
476 datafilestargetlist.append(dir + os.sep + f)
479 dotblendlist.append(os.path.join(dp, f))
480 dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[1:])) # skip bin
481 dottargetlist.append(dir + os.sep + f)
483 dotblenderinstall = []
484 for targetdir,srcfile in zip(dottargetlist, dotblendlist):
485 td, tf = os.path.split(targetdir)
486 dotblenderinstall.append(env.Install(dir=td, source=srcfile))
487 for targetdir,srcfile in zip(datafilestargetlist, datafileslist):
488 td, tf = os.path.split(targetdir)
489 dotblenderinstall.append(env.Install(dir=td, source=srcfile))
491 if env['WITH_BF_PYTHON']:
492 #-- local/VERSION/scripts
493 scriptpaths=['release/scripts']
494 for scriptpath in scriptpaths:
495 for dp, dn, df in os.walk(scriptpath):
500 if '__pycache__' in dn: # py3.2 cache dir
501 dn.remove('__pycache__')
503 dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
504 dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
506 source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
507 # To ensure empty dirs are created too
509 env.Execute(Mkdir(dir))
510 scriptinstall.append(env.Install(dir=dir,source=source))
513 if env['OURPLATFORM']=='linux2':
517 for tp, tn, tf in os.walk('release/freedesktop/icons'):
523 iconlist.append(os.path.join(tp, f))
524 icontargetlist.append( os.path.join(*([env['BF_INSTALLDIR']] + tp.split(os.sep)[2:] + [f])) )
527 for targetdir,srcfile in zip(icontargetlist, iconlist):
528 td, tf = os.path.split(targetdir)
529 iconinstall.append(env.Install(dir=td, source=srcfile))
531 # dlls for linuxcross
532 # TODO - add more libs, for now this lets blenderlite run
533 if env['OURPLATFORM']=='linuxcross':
534 dir=env['BF_INSTALLDIR']
537 if env['WITH_BF_OPENMP']:
538 source += ['../lib/windows/pthreads/lib/pthreadGC2.dll']
540 scriptinstall.append(env.Install(dir=dir, source=source))
545 for tp, tn, tf in os.walk('release/plugins'):
550 df = tp[8:] # remove 'release/'
552 pluglist.append(os.path.join(tp, f))
553 plugtargetlist.append( os.path.join(env['BF_INSTALLDIR'], VERSION, df, f) )
556 # header files for plugins
557 pluglist.append('source/blender/blenpluginapi/documentation.h')
558 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'documentation.h'))
559 pluglist.append('source/blender/blenpluginapi/externdef.h')
560 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'externdef.h'))
561 pluglist.append('source/blender/blenpluginapi/floatpatch.h')
562 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'floatpatch.h'))
563 pluglist.append('source/blender/blenpluginapi/iff.h')
564 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'iff.h'))
565 pluglist.append('source/blender/blenpluginapi/plugin.h')
566 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'plugin.h'))
567 pluglist.append('source/blender/blenpluginapi/util.h')
568 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'util.h'))
569 pluglist.append('source/blender/blenpluginapi/plugin.DEF')
570 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'plugin.def'))
573 # plugins in blender 2.5 don't work at the moment.
574 #for targetdir,srcfile in zip(plugtargetlist, pluglist):
575 # td, tf = os.path.split(targetdir)
576 # plugininstall.append(env.Install(dir=td, source=srcfile))
580 for tp, tn, tf in os.walk('release/text'):
586 textlist.append(tp+os.sep+f)
588 textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
590 if env['OURPLATFORM']=='darwin':
591 allinstall = [blenderinstall, plugininstall, textinstall]
592 elif env['OURPLATFORM']=='linux2':
593 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall]
595 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
597 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
600 if not env['OURPLATFORM'] in ('win32-mingw', 'win64-vc', 'linuxcross'):
601 # For MinGW and linuxcross static linking will be used
602 dllsources += ['${LCGDIR}/gettext/lib/gnu_gettext.dll']
604 #currently win64-vc doesn't appear to have libpng.dll
605 if env['OURPLATFORM'] != 'win64-vc':
606 dllsources += ['${BF_PNG_LIBPATH}/libpng.dll']
608 dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
609 # Used when linking to libtiff was dynamic
610 # keep it here until compilation on all platform would be ok
611 # dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
613 if env['OURPLATFORM'] != 'linuxcross':
614 # pthreads library is already added
615 dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
617 if env['WITH_BF_SDL']:
618 if env['OURPLATFORM'] == 'win64-vc':
619 pass # we link statically already to SDL on win64
621 dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
623 if env['WITH_BF_PYTHON']:
625 dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
627 dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
629 if env['WITH_BF_ICONV']:
630 if env['OURPLATFORM'] == 'win64-vc':
631 pass # we link statically to iconv on win64
632 elif not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
633 #gettext for MinGW and cross-compilation is compiled staticly
634 dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
636 if env['WITH_BF_OPENAL']:
637 dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
638 dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
640 if env['WITH_BF_SNDFILE']:
641 dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
643 if env['WITH_BF_FFMPEG']:
644 dllsources += ['${BF_FFMPEG_LIBPATH}/avcodec-52.dll',
645 '${BF_FFMPEG_LIBPATH}/avformat-52.dll',
646 '${BF_FFMPEG_LIBPATH}/avdevice-52.dll',
647 '${BF_FFMPEG_LIBPATH}/avutil-50.dll',
648 '${BF_FFMPEG_LIBPATH}/swscale-0.dll']
650 # Since the thumb handler is loaded by Explorer, architecture is
651 # strict: the x86 build fails on x64 Windows. We need to ship
652 # both builds in x86 packages.
654 dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb.dll')
655 dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
657 dllsources.append('#source/icons/blender.exe.manifest')
659 windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
660 allinstall += windlls
662 installtarget = env.Alias('install', allinstall)
663 bininstalltarget = env.Alias('install-bin', blenderinstall)
665 nsisaction = env.Action(btools.NSIS_Installer, btools.NSIS_print)
666 nsiscmd = env.Command('nsisinstaller', None, nsisaction)
667 nsisalias = env.Alias('nsis', nsiscmd)
669 if 'blender' in B.targets:
670 blenderexe= env.Alias('blender', B.program_list)
671 Depends(blenderexe,installtarget)
673 if env['WITH_BF_PLAYER']:
674 blenderplayer = env.Alias('blenderplayer', B.program_list)
675 Depends(blenderplayer,installtarget)
677 if not env['WITH_BF_GAMEENGINE']:
678 blendernogame = env.Alias('blendernogame', B.program_list)
679 Depends(blendernogame,installtarget)
681 if 'blenderlite' in B.targets:
682 blenderlite = env.Alias('blenderlite', B.program_list)
683 Depends(blenderlite,installtarget)
685 Depends(nsiscmd, allinstall)
687 buildslave_action = env.Action(btools.buildslave, btools.buildslave_print)
688 buildslave_cmd = env.Command('buildslave_exec', None, buildslave_action)
689 buildslave_alias = env.Alias('buildslave', buildslave_cmd)
691 Depends(buildslave_cmd, allinstall)
693 Default(B.program_list)
695 if not env['WITHOUT_BF_INSTALL']:
696 Default(installtarget)