563b3319f8e27ea7fe121d8dd8966245a9a36776
[libsub.git] / src / wscript
1 from waflib import TaskGen
2
3 def build(bld):
4     if bld.env.STATIC:
5         obj = bld(features='cxx cxxstlib')
6     else:
7         obj = bld(features='cxx cxxshlib')
8
9     obj.name = 'libsub%s' % bld.env.API_VERSION
10     obj.target = 'sub%s' % bld.env.API_VERSION
11     obj.uselib = 'CXML BOOST_FILESYSTEM BOOST_LOCALE BOOST_REGEX'
12     obj.export_includes = ['.']
13     obj.source = """
14                  colour.cc
15                  effect.cc
16                  exceptions.cc
17                  font_size.cc
18                  horizontal_position.cc
19                  iso6937.cc
20                  iso6937_tables.cc
21                  locale_convert.cc
22                  rational.cc
23                  raw_convert.cc
24                  raw_subtitle.cc
25                  reader.cc
26                  reader_factory.cc
27                  ssa_reader.cc
28                  stl_binary_reader.cc
29                  stl_binary_tables.cc
30                  stl_binary_writer.cc
31                  stl_text_reader.cc
32                  stl_util.cc
33                  sub_time.cc
34                  subrip_reader.cc
35                  subtitle.cc
36                  util.cc
37                  vertical_reference.cc
38                  vertical_position.cc
39                  web_vtt_reader.cc
40                  """
41
42     headers = """
43               collect.h
44               colour.h
45               effect.h
46               exceptions.h
47               font_size.h
48               horizontal_position.h
49               horizontal_reference.h
50               rational.h
51               raw_subtitle.h
52               reader.h
53               reader_factory.h
54               ssa_reader.h
55               stl_binary_tables.h
56               stl_binary_reader.h
57               stl_binary_writer.h
58               stl_text_reader.h
59               sub_time.h
60               subrip_reader.h
61               subtitle.h
62               vertical_position.h
63               vertical_reference.h
64               web_vtt_reader.h
65               """
66
67     bld.install_files('${PREFIX}/include/libsub%s/sub' % bld.env.API_VERSION, headers)
68     if bld.env.STATIC:
69         bld.install_files('${PREFIX}/lib', 'libsub%s.a' % bld.env.API_VERSION)