Page MenuHomec4science

site_init.py
No OneTemporary

File Metadata

Created
Mon, Oct 14, 07:48

site_init.py

from SCons.Script import *
from os.path import *
def tamaas(env):
"""Sets correct environement variables for Tamaas.
- 'TAMAAS_PATH' is list of potential tamaas repositories
- 'TAMAAS_BUILD_TYPE' is the build type of tamaas (release, debug, profiling)"""
if env.GetOption("clean"): return
build_type = "release"
if 'TAMAAS_BUILD_TYPE' in env:
build_type = env['TAMAAS_BUILD_TYPE']
path = findPath(env['TAMAAS_PATH'], build_type)
if not path:
print "Tamaas ({}) not found in {}".format(build_type, env['TAMAAS_PATH'])
Exit(1)
env.AppendUnique(CPPPATH = [abspath(join(path, 'src'))])
env.AppendUnique(LIBPATH = [abspath(join(path, 'build-{}/src'.format(build_type)))])
env.AppendUnique(RPATH = [abspath(join(path, 'build-{}/src'.format(build_type)))])
def findPath(search, build_type):
trial = Environment()
conf = Configure(trial)
for path in search:
trial['CPPPATH'] = join(path, 'src')
trial['LIBPATH'] = join(path, 'build-{}/src'.format(build_type))
trial['RPATH'] = join(path, 'build-{}/src'.format(build_type))
if conf.CheckLib("Tamaas", language="CXX"):
return path

Event Timeline