def require_openexr(env, ver=None, **keywords): env.Append(CPPPATH=env['OPENEXR_CPPPATH']) env.Append(LIBPATH=env['OPENEXR_LIBPATH']) if env.platform() == "windows": outdir = ARGUMENTS.get('dependency-dir') repdir = "z:/marza/team/rnd/libs" check = outdir + "/include/zlib.h" if not os.path.exists(check): #deps.fetch(repdir, outdir, ["zlib-1.2.3"]) deps.fetch(repdir, outdir, ["zlib"]) check = outdir + "/include/OpenEXR/OpenEXRConfig.h" if not os.path.exists(check): deps.fetch(repdir, outdir, ["openexr-%s" % ver if ver else "openexr"]) if env.compiler_ver() > 7.1: env.Append(LIBS=env['OPENEXR_LIBS_VC80']) else: env.Append(LIBS=env['OPENEXR_LIBS_VC71']) else: env.Append(LIBS=env['OPENEXR_LIBS'])
def require_expat(env, ver=None): outdir = ARGUMENTS.get('dependency-dir') if env.platform() == "windows": repdir = "z:/marza/team/rnd/libs" check = outdir+"/include/expat/expat.h" if not os.path.exists(check): deps.fetch(repdir, outdir, ["expat-%s" % ver if ver else "expat"]) env.Append(CPPPATH = env['EXPAT_CPPPATH']) env.Append(LIBS = env['EXPAT_LIBS'])
def require_opengl(env): if env.platform() == "windows": outdir = ARGUMENTS.get('dependency-dir') repdir = "z:/marza/team/rnd/libs" check = outdir + "/include/GL/glext.h" if not os.path.exists(check): deps.fetch(repdir, outdir, ["glext"]) env.Append(CPPPATH=[env.deps_dir() + "/include"]) env.Append(LINKFLAGS=env['GL_LINKFLAGS']) env.Append(LIBS=env['GL_LIBS'])
def require_boost(env, ver=None, **kwargs): if env.platform() == "windows": outdir = ARGUMENTS.get('dependency-dir') repdir = "z:/marza/team/rnd/libs" check = outdir + "/include/boost/config.hpp" if not os.path.exists(check): deps.fetch(repdir, outdir, ["boost-%s" % ver if ver else "boost"]) if "boost_libs" in kwargs: alllibs = outdir + "/lib/" if env.build_64(): alllibs += "x64/*.lib" else: alllibs += "x86/*.lib" for lib in kwargs["boost_libs"]: libname = "boost_%s" % lib check = outdir + "/lib/%s" % libname doFetch = True for l in glob.glob(alllibs): if re.search(libname, os.path.basename(l)): doFetch = False break if doFetch: deps.fetch(repdir, outdir, ["%s-%s" % (libname, ver) if ver else libname]) if "boost_libs" in kwargs: if env.platform() == "windows": # All libs but Boost.Python are statically linked by default if "static_link" in kwargs and kwargs["static_link"]: for lib in kwargs["boost_libs"]: libname = lib.strip().split("-")[0] if libname == "python": env["BOOST_CPPDEFINES"].append( "BOOST_PYTHON_STATIC_LIB") elif libname == "thread": env["BOOST_CPPDEFINES"].append("BOOST_THREAD_USE_LIB") else: for lib in kwargs["boost_libs"]: libname = lib.strip().split("-")[0] if libname == "thread": env["BOOST_CPPDEFINES"].append("BOOST_THREAD_USE_DLL") elif libname != "python": env["BOOST_CPPDEFINES"].append("BOOST_%s_DYN_LINK" % libname.upper()) else: # Not required on windows (auto-linking) for lib in kwargs["boost_libs"]: env["BOOST_LIBS"].append("boost_%s" % lib.strip()) env.Append(CPPDEFINES=env["BOOST_CPPDEFINES"]) env.Append(CPPPATH=env["BOOST_CPPPATH"]) env.Append(LIBPATH=env["BOOST_LIBPATH"]) env.Append(LIBS=env["BOOST_LIBS"])
def require_wx(env, ver=None): if env.platform() == "windows": outdir = ARGUMENTS.get('dependency-dir') repdir = "z:/marza/team/rnd/libs" check = outdir + "/include/wx/wx.h" if not os.path.exists(check): deps.fetch(repdir, outdir, ["wx-%s" % ver if ver else "wx"]) env.Append(CFLAGS=env["WX_CFLAGS"]) env.Append(CPPDEFINES=env["WX_CPPDEFINES"]) env.Append(CPPPATH=env["WX_CPPPATH"]) env.Append(LINKFLAGS=env["WX_LINKFLAGS"]) env.Append(LIBPATH=env["WX_LIBPATH"]) env.Append(LIBS=env["WX_LIBS"])
def require_imagemagick(env, ver=None, **kwargs): if env.platform() == "windows": outdir = ARGUMENTS.get('dependency-dir') repdir = "z:/marza/team/rnd/libs" check = outdir + "/include/magick/MagickCore.h" if not os.path.exists(check): deps.fetch(repdir, outdir, ["ImageMagick-%s" % ver if ver else "ImageMagick"]) env.Append(CPPDEFINES=env["IMAGEMAGICK_CPPDEFINES"]) env.Append(CPPPATH=env["IMAGEMAGICK_CPPPATH"]) env.Append(LIBPATH=env["IMAGEMAGICK_LIBPATH"]) env.Append(LIBS=env["IMAGEMAGICK_LIBS"])
def require_ofx(env, ver=None): if env.platform() == "windows": outdir = ARGUMENTS.get('dependency-dir') repdir = "z:/marza/team/rnd/libs" check = outdir+"/include/ofxCore.h" if not os.path.exists(check): pkg = ("openfx-%s" % ver) if ver is not None else "openfx" deps.fetch(repdir, outdir, [pkg]) env.ignore_import_lib() env["OPENFX_VERSION"] = ("" if ver is None else str(ver)) env['SHLIBPREFIX'] = '' env['SHLIBSUFFIX'] = env['OFX_MOD_SUFFIX'] if str(Platform()) == 'darwin': env['SHLINKFLAGS'] = '$LINKFLAGS -bundle'
def require_freeimage_base(env, ver=None): if env.platform() in ["windows", "linux"]: outdir = ARGUMENTS.get('dependency-dir') repdir = "/marza/team/rnd/libs" if env.platform() == "windows": repdir = "z:" + repdir check = outdir + "/include/FreeImage.h" if not os.path.exists(check): deps.fetch(repdir, outdir, ["freeimage-%s" % ver if ver else "freeimage"]) env.Append(CPPPATH=[env.deps_dir() + "/include"]) elif env.platform() == "osx": env.Append(CPPPATH=["/opt/local/include"]) env.Append(LIBPATH=["/opt/local/lib"])
def require_fbx_base(env, ver): if env.platform() == "windows": outdir = ARGUMENTS.get('dependency-dir') repdir = "/marza/team/rnd/libs" if env.platform() == "windows": repdir = "z:" + repdir check = outdir + "/include/fbxsdk.h" if not os.path.exists(check): deps.fetch(repdir, outdir, ["fbx-%s" % ver if ver else "fbx"]) env.Append(CPPPATH=[env.deps_dir() + "/include"]) env.Append(LIBPATH=[env.deps_dir() + "/lib"]) return True else: return False
def require_glm(env, ver=None): repdir = "" if env.platform() == "windows": repdir = "z:/marza/team/rnd/libs" else: repdir = "/marza/team/rnd/libs" outdir = ARGUMENTS.get('dependency-dir') check = outdir + "/include/glm/glm.hpp" if not os.path.exists(check): deps.fetch(repdir, outdir, ["glm-%s" % ver if ver else "glm"]) env.Append(CPPPATH=[outdir + "/include"])
def require_ocio(env, ver=None): outdir = ARGUMENTS.get('dependency-dir') repdir = "/marza/team/rnd/libs" if env.platform() == "windows": repdir = "z:" + repdir checkpath = "/include/OpenColorIO/OpenColorIO.h" check = outdir + checkpath if not os.path.exists(check): deps.fetch(repdir, outdir, ["ocio-%s" % ver if ver else "ocio"]) env.Append(CPPDEFINES=env['OCIO_CPPDEFINES']) env.Append(CPPPATH=env['OCIO_CPPPATH']) env.Append(LIBS=env['OCIO_LIBS'])