diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-12-16 13:38:58 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-12-16 13:41:18 +0000 |
commit | e519a6bd2e3f66036fefc658a467e86dbc788a96 (patch) | |
tree | ab61dcff295b49c12b9cb303ba4397357a2d33ae | |
parent | 9d1bfb2b0bdb400ad37857ac6bc58ed25cd9fd1f (diff) |
Allow to specify installation directory.
Drop the packaging stuff -- not very cross platform.
-rw-r--r-- | src/SConstruct | 18 | ||||
-rw-r--r-- | src/glean/SConscript | 6 | ||||
-rw-r--r-- | src/tools/difftiff/SConscript | 6 | ||||
-rw-r--r-- | src/tools/showtiff/SConscript | 6 | ||||
-rw-r--r-- | src/tools/showvis/SConscript | 6 |
5 files changed, 26 insertions, 16 deletions
diff --git a/src/SConstruct b/src/SConstruct index 0e5c0cd..3a91dc7 100644 --- a/src/SConstruct +++ b/src/SConstruct @@ -26,6 +26,11 @@ else: default_machine = platform.machine() default_machine = _machine_map.get(default_machine, 'generic') +if default_platform == 'windows': + default_prefix = os.path.join(os.environ.get('ProgramFiles', 'C:\\Program Files'), 'glean') +else: + default_prefix = '/usr/local' + vars = Variables() vars.Add(BoolVariable('debug', 'debug build', 'yes')) vars.Add(EnumVariable('platform', 'target platform', default_platform, @@ -34,6 +39,7 @@ vars.Add(EnumVariable('machine', 'use machine-specific assembly code', default_m allowed_values=('generic', 'ppc', 'x86', 'x86_64'))) vars.Add(EnumVariable('toolchain', 'compiler toolchain', 'default', allowed_values=('default', 'crossmingw', 'winsdk'))) +vars.Add(PathVariable('prefix', 'installation prefix', default_prefix, PathVariable.PathIsDirCreate)) if platform.machine() == 'win32': vars.Add(EnumVariable('MSVS_VERSION', 'Microsoft Visual Studio version', None, allowed_values=('7.1', '8.0', '9.0'))) @@ -228,15 +234,3 @@ env.Prepend(CPPPATH = [ env.VariantDir(build_dir, '.', duplicate=0) SConscript('SConscript', build_dir=build_dir, duplicate=0) - -env.Tool('packaging') -env.Package( - NAME = 'glean', - #VERSION = '1.1' + '-' + env['variant'], - VERSION = env['variant'] + '-' + '1.1', - PACKAGEVERSION = 0, - PACKAGETYPE = 'zip', - LICENSE = 'mit', - SUMMARY = 'An OpenGL Test and Benchmarking Suite', - URL = 'http://glean.sourceforge.net/' -) diff --git a/src/glean/SConscript b/src/glean/SConscript index 46b1e71..3a39966 100644 --- a/src/glean/SConscript +++ b/src/glean/SConscript @@ -1,3 +1,5 @@ +import os.path + Import(['*']) env = env.Clone() @@ -80,4 +82,6 @@ glean = env.Program( env.Default(glean) -env.Install('/bin', glean) +bin_dir = os.path.join(env['prefix'], 'bin') +env.Install(bin_dir, glean) +env.Alias('install', bin_dir) diff --git a/src/tools/difftiff/SConscript b/src/tools/difftiff/SConscript index a766fc1..56ca5a1 100644 --- a/src/tools/difftiff/SConscript +++ b/src/tools/difftiff/SConscript @@ -1,3 +1,5 @@ +import os.path + Import(['*']) if env['glut']: @@ -9,4 +11,6 @@ if env['glut']: env.Default(difftiff) - env.Install('/bin', difftiff) + bin_dir = os.path.join(env['prefix'], 'bin') + env.Install(bin_dir, difftiff) + env.Alias('install', bin_dir) diff --git a/src/tools/showtiff/SConscript b/src/tools/showtiff/SConscript index d5518da..52a1a72 100644 --- a/src/tools/showtiff/SConscript +++ b/src/tools/showtiff/SConscript @@ -1,3 +1,5 @@ +import os.path + Import(['*']) if env['glut']: @@ -9,4 +11,6 @@ if env['glut']: env.Default(showtiff) - env.Install('/bin', showtiff) + bin_dir = os.path.join(env['prefix'], 'bin') + env.Install(bin_dir, showtiff) + env.Alias('install', bin_dir) diff --git a/src/tools/showvis/SConscript b/src/tools/showvis/SConscript index d64168f..42f09d4 100644 --- a/src/tools/showvis/SConscript +++ b/src/tools/showvis/SConscript @@ -1,3 +1,5 @@ +import os.path + Import(['*']) env = env.Clone() @@ -8,4 +10,6 @@ showvis = env.Program('showvis', ['main.cpp']) env.Default(showvis) -env.Install('/bin', showvis) +bin_dir = os.path.join(env['prefix'], 'bin') +env.Install(bin_dir, showvis) +env.Alias('install', bin_dir) |