remove ipmidi debugging
[ardour.git] / libs / midi++2 / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
4 import os
5 import sys
6
7 # Version of this package (even if built as a child)
8 MAJOR = '2'
9 MINOR = '1'
10 MICRO = '1'
11 LIBMIDIPP_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
12
13 # Library version (UNIX style major, minor, micro)
14 # major increment <=> incompatible changes
15 # minor increment <=> compatible changes (additions)
16 # micro increment <=> no interface changes
17 LIBMIDIPP_LIB_VERSION = '4.1.0'
18
19 # Variables for 'waf dist'
20 APPNAME = 'libmidipp'
21 VERSION = LIBMIDIPP_VERSION
22
23 # Mandatory variables
24 top = '.'
25 out = 'build'
26
27 path_prefix = 'libs/midi++2/'
28
29
30 libmidi_sources = [
31         'midi.cc',
32         'channel.cc',
33         'ipmidi_port.cc',
34         'parser.cc',
35         'port.cc',
36         'midnam_patch.cc',
37         'mmc.cc',
38         'mtc.cc',
39 ]
40
41 def options(opt):
42     autowaf.set_options(opt)
43     opt.add_option('--test', action='store_true', default=False, dest='build_tests',
44                     help="Build unit tests")
45
46 def configure(conf):
47     conf.load('compiler_cxx')
48     autowaf.configure(conf)
49     autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
50     autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
51     autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
52
53     # Boost headers
54     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
55     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
56
57 def build(bld):
58     # Library
59     if bld.is_defined ('INTERNAL_SHARED_LIBS'):
60         obj              = bld.shlib(features = 'cxx cxxshlib', source=libmidi_sources)
61         obj.defines      = [ 'LIBMIDIPP_DLL_EXPORTS=1' ]
62     else:
63         obj              = bld.stlib(features = 'cxx cxxstlib', source=libmidi_sources)
64         obj.cxxflags     = [ '-fPIC' ]
65         obj.defines      = []
66
67     # everybody loves JACK
68     obj.export_includes = ['.']
69     obj.includes     = ['.', '../surfaces/control_protocol', '../ardour' ]
70     obj.name         = 'libmidipp'
71     obj.target       = 'midipp'
72     obj.uselib       = 'GLIBMM SIGCPP XML OSX'
73     obj.use          = 'libpbd libevoral libtimecode'
74     obj.vnum         = LIBMIDIPP_LIB_VERSION
75     obj.install_path = bld.env['LIBDIR']
76
77     if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
78         # Unit tests
79         obj              = bld(features = 'cxx cxxprogram')
80         obj.source       = '''
81                 test/MidnamTest.cpp
82                 test/testrunner.cpp
83         '''
84         obj.includes     = ['.', './src']
85         obj.use          = 'libmidipp'
86         obj.uselib       = 'CPPUNIT XML'
87         obj.target       = 'run-tests'
88         obj.name         = 'libmidipp-tests'
89         obj.install_path = ''
90
91 def shutdown():
92     autowaf.shutdown()