2011-03-02 07:37:39 -05:00
|
|
|
#!/usr/bin/env python
|
2011-09-29 15:17:54 -04:00
|
|
|
from waflib.extras import autowaf as autowaf
|
2011-03-02 07:37:39 -05:00
|
|
|
import os
|
|
|
|
|
|
|
|
# Version of this package (even if built as a child)
|
|
|
|
QM_DSP_VERSION = '0.0.0'
|
|
|
|
|
|
|
|
# Library version (UNIX style major, minor, micro)
|
|
|
|
# major increment <=> incompatible changes
|
|
|
|
# minor increment <=> compatible changes (additions)
|
|
|
|
# micro increment <=> no interface changes
|
|
|
|
QM_DSP_LIB_VERSION = '0.0.0'
|
|
|
|
|
|
|
|
# Variables for 'waf dist'
|
|
|
|
APPNAME = 'qm-dsp'
|
|
|
|
VERSION = QM_DSP_VERSION
|
|
|
|
|
|
|
|
# Mandatory variables
|
2011-09-29 15:17:54 -04:00
|
|
|
top = '.'
|
|
|
|
out = 'build'
|
2011-03-02 07:37:39 -05:00
|
|
|
|
2011-09-29 15:17:54 -04:00
|
|
|
def options(opt):
|
2011-04-22 18:15:21 -04:00
|
|
|
autowaf.set_options(opt)
|
2011-03-02 07:37:39 -05:00
|
|
|
|
|
|
|
def configure(conf):
|
2016-08-14 17:49:53 -04:00
|
|
|
if conf.is_defined('USE_EXTERNAL_LIBS'):
|
|
|
|
conf.check_cxx(header_name="base/Pitch.h", mandatory=True)
|
|
|
|
conf.check_cxx(lib="qm-dsp", uselib_store="QMDSP", mandatory=True)
|
|
|
|
else:
|
|
|
|
conf.load('compiler_cxx')
|
|
|
|
autowaf.configure(conf)
|
2011-03-02 07:37:39 -05:00
|
|
|
|
|
|
|
def build(bld):
|
2016-08-14 17:49:53 -04:00
|
|
|
if bld.is_defined('USE_EXTERNAL_LIBS'):
|
|
|
|
return
|
|
|
|
|
2011-04-22 18:15:21 -04:00
|
|
|
# Host Library
|
2016-10-05 18:16:44 -04:00
|
|
|
obj = bld(features = 'c cxx cxxshlib')
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.source = '''
|
2016-10-05 18:16:44 -04:00
|
|
|
base/Pitch.cpp
|
|
|
|
base/KaiserWindow.cpp
|
|
|
|
base/SincWindow.cpp
|
|
|
|
dsp/chromagram/Chromagram.cpp
|
|
|
|
dsp/chromagram/ConstantQ.cpp
|
|
|
|
dsp/keydetection/GetKeyMode.cpp
|
|
|
|
dsp/mfcc/MFCC.cpp
|
2011-04-22 18:15:21 -04:00
|
|
|
dsp/onsets/DetectionFunction.cpp
|
|
|
|
dsp/onsets/PeakPicking.cpp
|
|
|
|
dsp/phasevocoder/PhaseVocoder.cpp
|
|
|
|
dsp/rateconversion/Decimator.cpp
|
2016-10-05 18:16:44 -04:00
|
|
|
dsp/rateconversion/DecimatorB.cpp
|
2011-04-22 18:15:21 -04:00
|
|
|
dsp/rhythm/BeatSpectrum.cpp
|
2016-10-05 18:16:44 -04:00
|
|
|
dsp/segmentation/cluster_melt.c
|
|
|
|
dsp/segmentation/ClusterMeltSegmenter.cpp
|
|
|
|
dsp/segmentation/cluster_segmenter.c
|
|
|
|
dsp/segmentation/Segmenter.cpp
|
2011-04-22 18:15:21 -04:00
|
|
|
dsp/signalconditioning/DFProcess.cpp
|
|
|
|
dsp/signalconditioning/Filter.cpp
|
|
|
|
dsp/signalconditioning/FiltFilt.cpp
|
|
|
|
dsp/signalconditioning/Framer.cpp
|
2016-10-05 18:16:44 -04:00
|
|
|
dsp/tempotracking/DownBeat.cpp
|
|
|
|
dsp/tempotracking/TempoTrack.cpp
|
|
|
|
dsp/tempotracking/TempoTrackV2.cpp
|
|
|
|
dsp/tonal/ChangeDetectionFunction.cpp
|
|
|
|
dsp/tonal/TCSgram.cpp
|
|
|
|
dsp/tonal/TonalEstimator.cpp
|
2011-04-22 18:15:21 -04:00
|
|
|
dsp/transforms/FFT.cpp
|
|
|
|
dsp/wavelet/Wavelet.cpp
|
2016-10-05 18:16:44 -04:00
|
|
|
hmm/hmm.c
|
2011-04-22 18:15:21 -04:00
|
|
|
maths/Correlation.cpp
|
|
|
|
maths/CosineDistance.cpp
|
|
|
|
maths/KLDivergence.cpp
|
|
|
|
maths/MathUtilities.cpp
|
2016-10-05 18:16:44 -04:00
|
|
|
maths/pca/pca.c
|
|
|
|
ext/kissfft/kiss_fft.c
|
|
|
|
ext/kissfft/tools/kiss_fftr.c
|
2011-04-22 18:15:21 -04:00
|
|
|
'''
|
2014-01-17 13:10:41 -05:00
|
|
|
autowaf.ensure_visible_symbols (obj, True)
|
2011-09-29 15:17:54 -04:00
|
|
|
obj.export_includes = ['.']
|
2016-10-05 18:16:44 -04:00
|
|
|
obj.includes = ['.', 'include/', 'ext/kissfft', 'ext/kissfft/tools/']
|
|
|
|
obj.defines = ['kiss_fft_scalar=double']
|
2016-08-14 17:49:53 -04:00
|
|
|
obj.name = 'libqm-dsp'
|
|
|
|
obj.target = 'qm-dsp'
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.vnum = QM_DSP_VERSION
|
2014-04-28 21:18:02 -04:00
|
|
|
obj.install_path = bld.env['LIBDIR']
|
2016-10-05 18:16:44 -04:00
|
|
|
if bld.env['build_target'] != 'mingw':
|
|
|
|
obj.cxxflags = [ '-fPIC' ]
|
|
|
|
obj.cflags = [ '-fPIC' ]
|
2011-03-02 07:37:39 -05:00
|
|
|
|
|
|
|
def shutdown():
|
2011-04-22 18:15:21 -04:00
|
|
|
autowaf.shutdown()
|