File: SConstruct

package info (click to toggle)
clam 1.4.0-5.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 17,780 kB
  • sloc: cpp: 92,499; python: 9,721; ansic: 1,602; xml: 444; sh: 239; makefile: 153; perl: 54; asm: 15
file content (54 lines) | stat: -rw-r--r-- 1,576 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/python

import os, glob, sys

libraryName='plugins_example'

def scanFiles(pattern, paths) :
	files = []
	for path in paths :
		files+=glob.glob(os.path.join(path,pattern))
	return files

def recursiveDirs(root) :
	return filter( (lambda a : a.rfind( ".svn")==-1 ),  [ a[0] for a in os.walk(root)]  )

options = Variables('options.cache', ARGUMENTS)
options.Add(PathVariable('clam_prefix', 'The prefix where CLAM was installed', ''))
options.Add(BoolVariable('crossmingw', 'Using MinGW crosscompiler mode', 'no') )

env = Environment(ENV=os.environ, options=options)
options.Save('options.cache', env)
Help(options.GenerateHelpText(env))
env.SConsignFile() # Single signature file

CLAMInstallDir = env['clam_prefix']
clam_sconstoolspath = os.path.join(CLAMInstallDir,'share','clam','sconstools')
if env['crossmingw'] :
	env.Tool('crossmingw', toolpath=[clam_sconstoolspath])
env.Tool('clam', toolpath=[clam_sconstoolspath])
env.EnableClamModules([
	'clam_core',
	'clam_audioio',
	'clam_processing',
	] , CLAMInstallDir)

sourcePaths = recursiveDirs(".")
sources = scanFiles('*.cxx', sourcePaths)
sources = dict.fromkeys(sources).keys()
if sys.platform=='linux2' :
	env.Append( CCFLAGS=['-g','-O3','-Wall'] )
libraries = [
	env.SharedLibrary(target=libraryName, source = sources),
	]
if sys.platform=="darwin" : #TODO fix. should be available in clamlibs pc
	env.Append( LIBPATH=['/opt/local/lib'] )
	env.Append( LIBS=['fftw3'] )
	

install = env.Install(os.path.join(CLAMInstallDir,'lib','clam'), libraries)

env.Alias('install', install)
env.Default(libraries)