2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
4 from waflib import TaskGen
7 # Version of this package (even if built as a child)
11 CANVAS_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 CANVAS_LIB_VERSION = '0.0.0'
19 # Variables for 'waf dist'
21 VERSION = CANVAS_VERSION
22 I18N_PACKAGE = 'libcanvas'
28 path_prefix = 'libs/canvas/'
69 autowaf.set_options(opt)
72 conf.load ('compiler_cxx')
73 autowaf.configure(conf)
74 autowaf.check_pkg(conf, 'cairomm-1.0', uselib_store='CAIROMM', atleast_version='1.8.4')
78 if bld.is_defined ('INTERNAL_SHARED_LIBS'):
79 obj = bld.shlib(features = 'cxx cxxshlib', source=canvas_sources)
80 obj.defines = [ 'LIBCANVAS_DLL_EXPORTS=1' ]
82 obj = bld.stlib(features = 'cxx cxxstlib', source=canvas_sources)
83 obj.cxxflags = [ '-fPIC' ]
84 obj.cflags = [ '-fPIC' ]
87 obj.export_includes = ['.']
89 obj.uselib = 'SIGCPP CAIROMM GTKMM BOOST XML'
90 obj.use = [ 'libpbd', 'libgtkmm2ext' ]
91 obj.name = 'libcanvas'
93 obj.vnum = CANVAS_LIB_VERSION
94 obj.install_path = bld.env['LIBDIR']
95 obj.defines += [ 'PACKAGE="' + I18N_PACKAGE + '"' ]
97 # canvas unit-tests are outdated
98 if False and bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
99 unit_testobj = bld(features = 'cxx cxxprogram')
100 unit_testobj.source = '''
103 test/optimizing_lookup_table.cc
113 unit_testobj.includes = obj.includes + ['test', '../pbd']
114 unit_testobj.uselib = 'CPPUNIT SIGCPP CAIROMM GTKMM'
115 unit_testobj.uselib_local = 'libcanvas libgtkmm2ext'
116 unit_testobj.name = 'libcanvas-unit-tests'
117 unit_testobj.target = 'run-tests'
118 unit_testobj.install_path = ''
119 unit_testobj.cxxflags = ['-DPACKAGE="libcanvastest"']
120 unit_testobj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
121 unit_testobj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFDIR']) + '"']
122 unit_testobj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
133 for t in manual_tests:
135 name = t[t.find('/')+1:-3]
136 manual_testobj = bld(features = 'cxx cxxprogram')
137 manual_testobj.source = t
138 manual_testobj.includes = obj.includes + ['test', '../pbd']
139 manual_testobj.uselib = 'CPPUNIT SIGCPP CAIROMM GTKMM'
140 manual_testobj.uselib_local = 'libcanvas libgtkmm2ext'
141 manual_testobj.name = 'libcanvas-manual-test-%s' % name
142 manual_testobj.target = target
143 manual_testobj.install_path = ''
146 benchmark/items_at_point.cc
147 benchmark/render_parts.cc
148 benchmark/render_from_log.cc
149 benchmark/render_whole.cc
154 name = t[t.find('/')+1:-3]
155 manual_testobj = bld(features = 'cxx cxxprogram')
156 manual_testobj.source = [ t, 'benchmark/benchmark.cc' ]
157 manual_testobj.includes = obj.includes + ['test', '../pbd']
158 manual_testobj.uselib = 'CPPUNIT SIGCPP CAIROMM GTKMM'
159 manual_testobj.uselib_local = 'libcanvas libgtkmm2ext'
160 manual_testobj.name = 'libcanvas-benchmark-%s' % name
161 manual_testobj.target = target
162 manual_testobj.install_path = ''