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