Bump version
[libcxml.git] / wscript
1 APPNAME = 'libcxml'
2 VERSION = '0.08'
3
4 def options(opt):
5     opt.load('compiler_cxx')
6     opt.add_option('--target-windows', action='store_true', default = False, help = 'set up to do a cross-compile to Windows')
7     opt.add_option('--static', action='store_true', default = False, help = 'build statically')
8
9 def configure(conf):
10     conf.load('compiler_cxx')
11     conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-O2'])
12
13     conf.env.TARGET_WINDOWS = conf.options.target_windows
14     conf.env.STATIC = conf.options.static
15
16     if conf.options.target_windows:
17         boost_lib_suffix = '-mt'
18     else:
19         boost_lib_suffix = ''
20
21     conf.check_cfg(package = 'libxml++-2.6', args = '--cflags --libs', uselib_store = 'LIBXML++', mandatory = True)
22
23     conf.check_cxx(fragment = """
24                    #include <boost/filesystem.hpp>\n
25                    int main() { boost::filesystem::copy_file ("a", "b"); }\n
26                    """,
27                    msg = 'Checking for boost filesystem library',
28                    libpath = '/usr/local/lib',
29                    lib = ['boost_filesystem%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix],
30                    uselib_store = 'BOOST_FILESYSTEM')
31
32     conf.check_cxx(fragment = """
33                               #define BOOST_TEST_MODULE Config test\n
34                               #include <boost/test/unit_test.hpp>\n
35                               int main() {}
36                               """,
37                               msg = 'Checking for boost unit testing library',
38                               lib = ['boost_unit_test_framework%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix],
39                               uselib_store = 'BOOST_TEST')
40
41     conf.recurse('test')
42
43 def build(bld):
44
45     bld(source = 'libcxml.pc.in',
46         version = VERSION,
47         includedir = '%s/include' % bld.env.PREFIX,
48         libs = "-L${libdir} -lcxml",
49         install_path = '${LIBDIR}/pkgconfig')
50
51     bld.recurse('src')
52     bld.recurse('test')