Import('env')
import os.path

env.Append(CPPDEFINES=["IMP_DATA_DIRECTORY=\\\""+env['datadir']+"\\\""])
env.Append(CPPDEFINES=["IMP_EXAMPLE_DIRECTORY=\\\""+os.path.join(env['docdir'],"examples")+"\\\""])

config=[]
if env['CGAL_LIBS'] != ['']:
    config.append('IMP_USE_CGAL')
else:
    config.append('IMP_NO_CGAL')

if env['BOOST_LIBS']:
    config.append('IMP_USE_BOOST_LIBS')
else:
    config.append('IMP_NO_BOOST_LIBS')

if not env.get('deprecated', True):
    config.append('IMP_NO_DEPRECATED')
else:
    config.append('IMP_USE_DEPRECATED')
if env['IMP_ENDIAN']=='little':
    config.append("IMP_LITTLE_ENDIAN")
else:
    config.append('IMP_BIG_ENDIAN')

if env.get("BOOST_VERSION", None):
    config.append(["IMP_BOOST_VERSION", env["BOOST_VERSION"]])
config.append(["IMP_DEBUG", "0"])
config.append(["IMP_RELEASE", "1"])
config.append(["IMP_FAST", "2"])

if env['build'] == 'fast':
    config.append(["IMP_BUILD", "IMP_FAST"])
elif env['build'] == 'release':
    config.append(["IMP_BUILD", "IMP_RELEASE"])
elif env['build'] == 'debug':
    config.append(["IMP_BUILD", "IMP_DEBUG"])


env.IMPModuleBuild(version='1.0', required_modules=None, config_macros=config,
                   module='kernel', module_suffix="", module_include_path="IMP",
                   module_src_path="kernel", module_preproc="IMP",
                   module_namespace="IMP",
                   optional_dependencies=['boost_file_system'])
