Fix export, which has been broken since the boost::signals2 changes. Also update...
[ardour.git] / libs / audiographer / wscript
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 import autowaf
4 import os
5
6 # Version of this package (even if built as a child)
7 AUDIOGRAPHER_VERSION = '0.0.0'
8
9 # Library version (UNIX style major, minor, micro)
10 # major increment <=> incompatible changes
11 # minor increment <=> compatible changes (additions)
12 # micro increment <=> no interface changes
13 # Version history:
14 #   0.0.0 = 0,0,0
15 AUDIOGRAPHER_LIB_VERSION = '0.0.0'
16
17 # Variables for 'waf dist'
18 APPNAME = 'audiographer'
19 VERSION = AUDIOGRAPHER_VERSION
20
21 # Mandatory variables
22 srcdir = '.'
23 blddir = 'build'
24
25 def set_options(opt):
26         autowaf.set_options(opt)
27
28 def configure(conf):
29         autowaf.configure(conf)
30         
31         conf.check_tool('compiler_cxx')
32         
33         autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
34         autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0', mandatory=False)
35         autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=False)
36         autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=False)
37         autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.14.0', mandatory=False)
38         autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.7', mandatory=False)
39         autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18', mandatory=False)
40         
41         # Boost headers
42         autowaf.check_header(conf, 'boost/shared_ptr.hpp')
43         autowaf.check_header(conf, 'boost/format.hpp')
44
45 def build(bld):
46
47         # Headers
48         #bld.install_files('${INCLUDEDIR}/audiographer', 'audiographer/*.h')
49         #bld.install_files('${INCLUDEDIR}/audiographer/general', 'audiographer/general/*.h')
50         #bld.install_files('${INCLUDEDIR}/audiographer/sndfile', 'audiographer/sndfile/*.h')
51         #bld.install_files('${INCLUDEDIR}/audiographer/utils', 'audiographer/utils/*.h')
52         
53         #bld.env['BUILD_TESTS'] = True
54         bld.env['HAVE_ALL_GTHREAD'] = bld.env['HAVE_GLIB'] and bld.env['HAVE_GLIBMM'] and bld.env['HAVE_GTHREAD']
55
56         audiographer = bld.new_task_gen('cxx', 'shlib')
57         audiographer.source = '''
58                 private/gdither/gdither.cc
59                 src/general/sample_format_converter.cc
60                 src/routines.cc
61                 src/debug_utils.cc
62         '''
63         
64         if bld.env['HAVE_SAMPLERATE']:
65                 audiographer.source += '''
66                         src/general/sr_converter.cc
67                 '''
68         
69         audiographer.name           = 'libaudiographer'
70         audiographer.target         = 'audiographer'
71         audiographer.export_incdirs = ['.', './src']
72         audiographer.includes       = ['.', './src']
73         audiographer.uselib         = 'GLIB GLIBMM GTHREAD SAMPLERATE SNDFILE'
74         audiographer.vnum           = AUDIOGRAPHER_LIB_VERSION
75         audiographer.install_path   = os.path.join(bld.env['LIBDIR'], 'ardour3')
76         
77
78         if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
79                 # Unit tests
80                 obj              = bld.new_task_gen('cxx', 'program')
81                 obj.source       = '''
82                         tests/test_runner.cc
83                         tests/type_utils_test.cc
84                         tests/utils/identity_vertex_test.cc
85                         tests/general/interleaver_test.cc
86                         tests/general/deinterleaver_test.cc
87                         tests/general/interleaver_deinterleaver_test.cc
88                         tests/general/chunker_test.cc
89                         tests/general/sample_format_converter_test.cc
90                         tests/general/peak_reader_test.cc
91                         tests/general/normalizer_test.cc
92                         tests/general/silence_trimmer_test.cc
93                 '''
94                 
95                 if bld.env['HAVE_ALL_GTHREAD']:
96                         obj.source += '''
97                                 tests/general/threader_test.cc
98                         '''
99                 
100                 if bld.env['HAVE_SNDFILE']:
101                         obj.source += '''
102                                 tests/sndfile/tmp_file_test.cc
103                         '''
104
105                 if bld.env['HAVE_SAMPLERATE']:
106                         obj.source += '''
107                                 tests/general/sr_converter_test.cc
108                         '''
109                 
110                 obj.uselib_local = 'libaudiographer'
111                 obj.uselib       = 'CPPUNIT GLIBMM'
112                 obj.target       = 'run-tests'
113                 obj.install_path = ''
114
115 def shutdown():
116         autowaf.shutdown()
117