Skip to content
Snippets Groups Projects
SConstruct 49 KiB
Newer Older
  • Learn to ignore specific revisions
  •             locale_name = os.path.splitext(f)[0]
    
                mo_file = os.path.join(B.root_build_dir, "locale", locale_name + ".mo")
    
                dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
                dir = os.path.join(dir, "datafiles", "locale", locale_name, "LC_MESSAGES")
                scriptinstall.append(env.InstallAs(os.path.join(dir, "blender.mo"), mo_file))
    
            # languages file
            dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
            dir = os.path.join(dir, "datafiles", "locale")
            languages_file = os.path.join("release", "datafiles", "locale", "languages")
            scriptinstall.append(env.InstallAs(os.path.join(dir, "languages"), languages_file))
    
    
    Ken Hughes's avatar
    Ken Hughes committed
    #-- icons
    
    if env['OURPLATFORM']=='linux':
    
        iconlist = []
        icontargetlist = []
    
        for tp, tn, tf in os.walk('release/freedesktop/icons'):
            for f in tf:
                iconlist.append(os.path.join(tp, f))
                icontargetlist.append( os.path.join(*([env['BF_INSTALLDIR']] + tp.split(os.sep)[2:] + [f])) )
    
        iconinstall = []
        for targetdir,srcfile in zip(icontargetlist, iconlist):
            td, tf = os.path.split(targetdir)
            iconinstall.append(env.Install(dir=td, source=srcfile))
    
    Ken Hughes's avatar
    Ken Hughes committed
    
    
        scriptinstall.append(env.Install(dir=env['BF_INSTALLDIR'], source='release/bin/blender-thumbnailer.py'))
    
    
    # dlls for linuxcross
    # TODO - add more libs, for now this lets blenderlite run
    if env['OURPLATFORM']=='linuxcross':
    
        dir=env['BF_INSTALLDIR']
        source = []
    
        if env['WITH_BF_OPENMP']:
            source += ['../lib/windows/pthreads/lib/pthreadGC2.dll']
    
        scriptinstall.append(env.Install(dir=dir, source=source))
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    textlist = []
    texttargetlist = []
    for tp, tn, tf in os.walk('release/text'):
    
        for f in tf:
            textlist.append(tp+os.sep+f)
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    
    
    # Font licenses
    
    textlist.append('release/datafiles/LICENSE-bfont.ttf.txt')
    
    if env['WITH_BF_INTERNATIONAL']:
    
        textlist += ['release/datafiles/LICENSE-droidsans.ttf.txt', 'release/datafiles/LICENSE-bmonofont-i18n.ttf.txt']
    
    Campbell Barton's avatar
    Campbell Barton committed
    textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    
    
    if  env['OURPLATFORM']=='darwin':
    
    Thomas Dinges's avatar
    Thomas Dinges committed
            allinstall = [blenderinstall, textinstall]
    
    elif env['OURPLATFORM']=='linux':
    
            allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, iconinstall, cubininstall]
    
            allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, cubininstall]
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    
    
    if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
    
        dllsources = []
    
        # Used when linking to libtiff was dynamic
        # keep it here until compilation on all platform would be ok
        # dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
    
        if env['OURPLATFORM'] != 'linuxcross':
            # pthreads library is already added
            dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
    
        if env['WITH_BF_SDL']:
            if env['OURPLATFORM'] == 'win64-vc':
                pass # we link statically already to SDL on win64
            else:
                dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
    
        if env['WITH_BF_PYTHON']:
            if env['BF_DEBUG']:
                dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
            else:
                dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
    
        if env['WITH_BF_ICONV']:
            if env['OURPLATFORM'] == 'win64-vc':
                pass # we link statically to iconv on win64
            elif not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
                #gettext for MinGW and cross-compilation is compiled staticly
                dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
    
        if env['WITH_BF_OPENAL']:
            dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
    
            if env['OURPLATFORM'] in ('win32-vc', 'win64-vc') and env['MSVC_VERSION'] == '11.0':
                pass
            else:
                dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
    
    
        if env['WITH_BF_SNDFILE']:
            dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
    
        if env['WITH_BF_FFMPEG']:
    
            dllsources += env['BF_FFMPEG_DLL'].split()
    
    
        # Since the thumb handler is loaded by Explorer, architecture is
        # strict: the x86 build fails on x64 Windows. We need to ship
        # both builds in x86 packages.
    
            dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb.dll')
    
        dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
    
    
        if env['WITH_BF_OCIO']:
            if not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
                dllsources.append('${LCGDIR}/opencolorio/bin/OpenColorIO.dll')
    
            else:
                dllsources.append('${LCGDIR}/opencolorio/bin/libOpenColorIO.dll')
    
        dllsources.append('#source/icons/blender.exe.manifest')
    
    
        windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
        allinstall += windlls
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    
    
        if env['WITH_BF_PYTHON']:
            if env['BF_DEBUG']:
                dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
            else:
                dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
    
        if env['WITH_BF_FFMPEG']:
            dllsources += env['BF_FFMPEG_DLL'].split()
    
        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')
    
        if env['WITH_BF_SDL']:
            dllsources.append('${LCGDIR}/sdl/lib/SDL.dll')
    
    
        if(env['WITH_BF_OPENMP']):
            dllsources.append('${LCGDIR}/binaries/libgomp-1.dll')
    
        if env['WITH_BF_OCIO']:
            dllsources.append('${LCGDIR}/opencolorio/bin/libOpenColorIO.dll')
    
        dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
    
        dllsources.append('${LCGDIR}/binaries/libgcc_s_sjlj-1.dll')
    
    Thomas Dinges's avatar
    Thomas Dinges committed
        dllsources.append('${LCGDIR}/binaries/libwinpthread-1.dll')
    
        dllsources.append('${LCGDIR}/binaries/libstdc++-6.dll')
    
        dllsources.append('#source/icons/blender.exe.manifest')
    
        windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
        allinstall += windlls
    
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    installtarget = env.Alias('install', allinstall)
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    bininstalltarget = env.Alias('install-bin', blenderinstall)
    
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    nsisaction = env.Action(btools.NSIS_Installer, btools.NSIS_print)
    nsiscmd = env.Command('nsisinstaller', None, nsisaction)
    nsisalias = env.Alias('nsis', nsiscmd)
    
    
        blenderexe= env.Alias('blender', B.program_list)
        Depends(blenderexe,installtarget)
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    if env['WITH_BF_PLAYER']:
    
        blenderplayer = env.Alias('blenderplayer', B.program_list)
        Depends(blenderplayer,installtarget)
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    
    if not env['WITH_BF_GAMEENGINE']:
    
        blendernogame = env.Alias('blendernogame', B.program_list)
        Depends(blendernogame,installtarget)
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    
    
    if 'blenderlite' in B.targets:
    
        blenderlite = env.Alias('blenderlite', B.program_list)
        Depends(blenderlite,installtarget)
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    Depends(nsiscmd, allinstall)
    
    
    buildslave_action = env.Action(btools.buildslave, btools.buildslave_print)
    buildslave_cmd = env.Command('buildslave_exec', None, buildslave_action)
    buildslave_alias = env.Alias('buildslave', buildslave_cmd)
    
    Depends(buildslave_cmd, allinstall)
    
    
    cudakernels_action = env.Action(btools.cudakernels, btools.cudakernels_print)
    cudakernels_cmd = env.Command('cudakernels_exec', None, cudakernels_action)
    cudakernels_alias = env.Alias('cudakernels', cudakernels_cmd)
    
    cudakernel_dir = os.path.join(os.path.abspath(os.path.normpath(B.root_build_dir)), 'intern/cycles/kernel')
    cuda_kernels = []
    
    for x in env['BF_CYCLES_CUDA_BINARIES_ARCH']:
        cubin = os.path.join(cudakernel_dir, 'kernel_' + x + '.cubin')
        cuda_kernels.append(cubin)
    
    Depends(cudakernels_cmd, cuda_kernels)
    Depends(cudakernels_cmd, cubininstall)
    
    
    Nathan Letwory's avatar
    Nathan Letwory committed
    Default(B.program_list)
    
    
    if not env['WITHOUT_BF_INSTALL']:
    
            Default(installtarget)