2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
7 # Version of this package (even if built as a child)
11 LIBMIDIPP_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
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'
19 # Variables for 'waf dist'
21 VERSION = LIBMIDIPP_VERSION
27 path_prefix = 'libs/midi++2/'
42 autowaf.set_options(opt)
43 opt.add_option('--test', action='store_true', default=False, dest='build_tests',
44 help="Build unit tests")
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')
54 autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
55 autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
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' ]
63 obj = bld.stlib(features = 'cxx cxxstlib', source=libmidi_sources)
64 obj.cxxflags = [ bld.env['compiler_flags_dict']['pic'] ]
67 # everybody loves JACK
68 obj.export_includes = ['.']
69 obj.includes = ['.', '../surfaces/control_protocol', '../ardour' ]
70 obj.name = 'libmidipp'
72 obj.uselib = 'GLIBMM SIGCPP XML OSX'
73 obj.use = 'libpbd libevoral libtemporal'
74 obj.vnum = LIBMIDIPP_LIB_VERSION
75 obj.install_path = bld.env['LIBDIR']
77 if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
79 obj = bld(features = 'cxx cxxprogram')
84 obj.includes = ['.', './src']
86 obj.uselib = 'CPPUNIT XML'
87 obj.target = 'run-tests'
88 obj.name = 'libmidipp-tests'