Commit 45674079 authored by Ludovic Courtès's avatar Ludovic Courtès

build: Add 'INSTALL_PREFIX' variable and 'install' alias.

parent 572f6aaa
......@@ -68,6 +68,9 @@ def program_file_name(choices):
return choices[0]
vars = Variables(configFile)
vars.Add('INSTALL_PREFIX', 'Parent installation directory',
default = '/usr/local')
vars.Add('CXX', 'C++ compiler',
default = program_file_name(cxx_compilers))
vars.Add('CCFLAGS', 'Compiler\'s flags',
......@@ -269,3 +272,5 @@ if 'tests' in COMMAND_LINE_TARGETS:
env.Depends(tests, plugins)
if 'python' in COMMAND_LINE_TARGETS:
env.Depends(tests, python)
env.Alias('install', env['INSTALL_PREFIX'])
......@@ -3,7 +3,6 @@ import sys
Import('env', 'ALTA_LIBS')
# Library sources
sources = ['common.cpp',
'data.cpp',
'data_storage.cpp',
......@@ -14,6 +13,20 @@ sources = ['common.cpp',
'vertical_segment.cpp',
'metrics.cpp']
headers = [ 'args.h',
'clustering.h',
'common.h',
'data.h',
'data_storage.h',
'fitter.h',
'function.h',
'metrics.h',
'params.h',
'plugins_manager.h',
'ptr.h',
'rational_function.h',
'vertical_segment.h' ]
CCFLAGS = env['CCFLAGS']
## Known compilation issue. If the core is not compiled with -fvisibility-hidden
......@@ -29,7 +42,10 @@ if env['CC'] != 'cl':
# contains PIC code. Thus, force '-fPIC'.
CCFLAGS = CCFLAGS + ' -fPIC'
env.StaticLibrary('#build/core/core', source = sources,
LIBS = ALTA_LIBS,
CPPPATH = env['CPPPATH'] + env['EIGEN_INC'],
CCFLAGS = CCFLAGS)
lib = env.StaticLibrary('#build/core/core', source = sources,
LIBS = ALTA_LIBS,
CPPPATH = env['CPPPATH'] + env['EIGEN_INC'],
CCFLAGS = CCFLAGS)
env.Install(env['INSTALL_PREFIX'] + '/lib', lib)
env.Install(env['INSTALL_PREFIX'] + '/include/alta', headers)
# Plug-ins.
Import('env')
import os
plugins = [ 'data_interpolants',
......@@ -96,3 +96,5 @@ if not GetOption('silent') and not GetOption('clean'):
print ""
print " See 'config.log' for details."
print ""
env.Install(env['INSTALL_PREFIX'] + '/lib/alta', targets)
Import('env', 'ALTA_LIBS')
sources = ['main.cpp']
env.Program('#build/softs/brdf2brdf', sources,
LIBS = ['core'] + ALTA_LIBS)
program = env.Program('#build/softs/brdf2brdf', sources,
LIBS = ['core'] + ALTA_LIBS)
env.Install(env['INSTALL_PREFIX'] + '/bin', program)
Import('env', 'ALTA_LIBS')
sources = ['main.cpp']
env.Program('#build/softs/brdf2data', sources,
LIBS = ['core'] + ALTA_LIBS)
program = env.Program('#build/softs/brdf2data', sources,
LIBS = ['core'] + ALTA_LIBS)
env.Install(env['INSTALL_PREFIX'] + '/bin', program)
Import('env', 'ALTA_LIBS')
sources = ['main.cpp']
env.Program('#build/softs/brdf2gnuplot', sources,
LIBS = ['core'] + ALTA_LIBS)
program = env.Program('#build/softs/brdf2gnuplot', sources,
LIBS = ['core'] + ALTA_LIBS)
env.Install(env['INSTALL_PREFIX'] + '/bin', program)
Import('env', 'ALTA_LIBS')
sources = ['main.cpp']
env.Program('#build/softs/data2brdf', sources,
LIBS = ['core'] + ALTA_LIBS)
program = env.Program('#build/softs/data2brdf', sources,
LIBS = ['core'] + ALTA_LIBS)
env.Install(env['INSTALL_PREFIX'] + '/bin', program)
......@@ -10,4 +10,5 @@ env.AppendUnique(LIBS = ALTA_LIBS)
sources = ['main.cpp']
env.Program('#build/softs/data2data', sources)
program = env.Program('#build/softs/data2data', sources)
env.Install(env['INSTALL_PREFIX'] + '/bin', program)
Import('env', 'ALTA_LIBS')
sources = ['main.cpp']
env.Program('#build/softs/brdf2moments', sources,
LIBS = ['core'] + ALTA_LIBS)
program = env.Program('#build/softs/brdf2moments', sources,
LIBS = ['core'] + ALTA_LIBS)
env.Install(env['INSTALL_PREFIX'] + '/bin', program)
......@@ -4,7 +4,6 @@ env = env.Clone()
env.Prepend(LIBS = ['core'])
env.AppendUnique(LIBS = ALTA_LIBS)
# Soft Sources
sources = ['data2stats.cpp']
env.Program('#build/softs/data2stats', sources)
program = env.Program('#build/softs/data2stats', sources)
env.Install(env['INSTALL_PREFIX'] + '/bin', program)
Import('env', 'ALTA_LIBS')
sources = ['fit2stat.cpp']
env.Program('#build/softs/fit2stat', sources,
LIBS = ['core'] + ALTA_LIBS)
program = env.Program('#build/softs/fit2stat', sources,
LIBS = ['core'] + ALTA_LIBS)
env.Install(env['INSTALL_PREFIX'] + '/bin', program)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment