platform = ARGUMENTS.get('OS', Platform())
#prefix = "/usr/share"


opts = Options()
opts.Add(PathOption('PREFIX', 'Install prefix', '/usr'))
env = Environment(options = opts)

#prefix=ARGUMENTS.get('prefix', '/usr/share')


print "Preparing Create Resource Files ..."
Export('env')

print 'Preparing Package Documentation ...'
packagedocs = ['COPYING', 'INSTALL']
installdir=env['PREFIX'] + '/share/doc/create'
env.Install(installdir, packagedocs)
ipdocs=env.Alias('install-package-docs', installdir)

SConscript(['brushes/SConscript', 'gradients/SConscript', 'patterns/SConscript', 'swatches/SConscript', 'docs/SConscript'])

Import('ibrgimp', 'igrgimp', 'igrk14', 'ipatb16', 'ipatb8', 'isw', 'idocs')
env.Alias('install',[ibrgimp, igrgimp, igrk14, ipatb16, ipatb8, isw, idocs, ipdocs])
