allow linking unbundled version of qm-dsp
[ardour.git] / libs / qm-dsp / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 import os
4
5 # Version of this package (even if built as a child)
6 QM_DSP_VERSION = '0.0.0'
7
8 # Library version (UNIX style major, minor, micro)
9 # major increment <=> incompatible changes
10 # minor increment <=> compatible changes (additions)
11 # micro increment <=> no interface changes
12 QM_DSP_LIB_VERSION = '0.0.0'
13
14 # Variables for 'waf dist'
15 APPNAME = 'qm-dsp'
16 VERSION = QM_DSP_VERSION
17
18 # Mandatory variables
19 top = '.'
20 out = 'build'
21
22 def options(opt):
23     autowaf.set_options(opt)
24
25 def configure(conf):
26     if conf.is_defined('USE_EXTERNAL_LIBS'):
27         conf.check_cxx(header_name="base/Pitch.h", mandatory=True)
28         conf.check_cxx(lib="qm-dsp", uselib_store="QMDSP", mandatory=True)
29     else:
30         conf.load('compiler_cxx')
31         autowaf.configure(conf)
32
33 def build(bld):
34     if bld.is_defined('USE_EXTERNAL_LIBS'):
35         return
36
37     # Host Library
38     obj = bld(features = 'cxx cxxshlib')
39     obj.source = '''
40             dsp/onsets/DetectionFunction.cpp
41             dsp/onsets/PeakPicking.cpp
42             dsp/phasevocoder/PhaseVocoder.cpp
43             dsp/rateconversion/Decimator.cpp
44             dsp/rhythm/BeatSpectrum.cpp
45             dsp/signalconditioning/DFProcess.cpp
46             dsp/signalconditioning/Filter.cpp
47             dsp/signalconditioning/FiltFilt.cpp
48             dsp/signalconditioning/Framer.cpp
49             dsp/transforms/FFT.cpp
50             dsp/wavelet/Wavelet.cpp
51             maths/Correlation.cpp
52             maths/CosineDistance.cpp
53             maths/KLDivergence.cpp
54             maths/MathUtilities.cpp
55             base/Pitch.cpp
56     '''
57     autowaf.ensure_visible_symbols (obj, True)
58     obj.export_includes = ['.']
59     obj.includes     = ['.']
60     obj.name         = 'libqm-dsp'
61     obj.target       = 'qm-dsp'
62     obj.vnum         = QM_DSP_VERSION
63     obj.install_path = bld.env['LIBDIR']
64
65 def shutdown():
66     autowaf.shutdown()