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