Update classkeys to match new total LuaSignal count (windows only)
[ardour.git] / libs / surfaces / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
4
5 # Version of this package (even if built as a child)
6 LIBSURFACES_VERSION = '4.1.0'
7
8 # Library version (UNIX style major, minor, micro)
9 # major increment <=> incompatible changes
10 # minor increment <=> compatible changes (additions)
11 # micro increment <=> no interface changes
12 LIBSURFACES_LIB_VERSION = '4.1.0'
13
14 # Variables for 'waf dist'
15 APPNAME = 'libsurfaces'
16 VERSION = LIBSURFACES_VERSION
17
18 # Mandatory variables
19 top = '.'
20 out = 'build'
21
22 children = [
23         'control_protocol',
24         'faderport',
25         'faderport8',
26         'cc121',
27         'generic_midi',
28         'mackie',
29         'us2400',
30         'launch_control_xl',
31 ]
32
33 def options(opt):
34     autowaf.set_options(opt)
35
36 def sub_config_and_use(conf, name, has_objects = True):
37     conf.recurse(name)
38     autowaf.set_local_lib(conf, name, has_objects)
39
40 def configure(conf):
41     global children
42
43     autowaf.set_recursive()
44     autowaf.configure(conf)
45
46     autowaf.check_pkg(conf, 'libusb-1.0', uselib_store='USB', mandatory=False)
47     #if Options.options.tranzport and conf.is_defined('HAVE_USB'):
48     #    conf.define('BUILD_TRANZPORT', 1)
49
50     if conf.is_defined('HAVE_USB'):
51         children += [ 'push2' ]
52     else:
53         print ('You are missing the libusb-1.0 development package needed to compile Push2 support')
54
55     if conf.is_defined('HAVE_HIDAPI') and Options.options.maschine:
56         children += [ 'maschine2' ]
57         conf.define('BUILD_MASCHINE', 1)
58
59     if autowaf.check_pkg (conf, 'liblo', mandatory=False, uselib_store="LO", atleast_version="0.24"):
60         children += [ 'osc' ]
61
62     conf.check_cc (header_name='cwiid.h', define_name='HAVE_CWIID_H',mandatory=False)
63     if conf.is_defined('HAVE_CWIID_H'):
64         conf.check_cc (header_name='bluetooth/bluetooth.h', define_name='HAVE_BLUETOOTH_H',mandatory=False)
65         if conf.is_defined('HAVE_BLUETOOTH_H'):
66             autowaf.check_pkg(conf, 'cwiid', uselib_store='CWIID', atleast_version='0.6.00',mandatory=False)
67             if conf.is_defined ('HAVE_CWIID'):
68                 conf.define ('BUILD_WIIMOTE', 1)
69                 children += [ 'wiimote' ]
70             else:
71                 print('You have the cwiid headers needed to compile wiimote support BUT you are missing the pkg-config file for cwiid')
72         else:
73             print('You are missing the libbluetooth headers needed to compile wiimote support')
74     else:
75             print('You are missing the cwiid headers needed to compile wiimote support')
76
77     for i in children:
78         sub_config_and_use(conf, i)
79
80
81 def build(bld):
82     bld.recurse('control_protocol')
83     bld.recurse('generic_midi')
84     bld.recurse('faderport')
85     bld.recurse('faderport8')
86     bld.recurse('cc121')
87     bld.recurse('mackie')
88     bld.recurse('us2400')
89     bld.recurse('launch_control_xl')
90
91     if bld.is_defined ('HAVE_LO'):
92         bld.recurse('osc')
93     if bld.is_defined('BUILD_WIIMOTE'):
94         bld.recurse('wiimote')
95     if bld.is_defined('BUILD_TRANZPORT'):
96         bld.recurse('tranzport')
97     if bld.is_defined('HAVE_USB'):
98         bld.recurse('push2')
99     if bld.is_defined('BUILD_MASCHINE'):
100         bld.recurse('maschine2')
101
102 def shutdown():
103     autowaf.shutdown()