423869cbde4842f5339efcd022330a85f96860e2
[platform/upstream/gstreamer.git] / gst-libs / gst / tag / meson.build
1 tag_sources = [
2   'gstvorbistag.c',
3   'gstid3tag.c',
4   'gstxmptag.c',
5   'gstexiftag.c',
6   'lang.c',
7   'licenses.c',
8   'tags.c',
9   'gsttagdemux.c',
10   'gsttagmux.c',
11   'gsttageditingprivate.c',
12   'id3v2.c',
13   'id3v2frames.c',
14   'xmpwriter.c',
15 ]
16
17 tag_mkenum_headers = [
18   'gsttagdemux.h',
19   'tag.h',
20 ]
21
22 tag_headers = tag_mkenum_headers + [
23   'gsttagmux.h',
24   'xmpwriter.h',
25   'tag-prelude.h',
26 ]
27 install_headers(tag_headers, subdir : 'gstreamer-1.0/gst/tag/')
28
29 tag_enums = gnome.mkenums_simple('tag-enumtypes',
30   sources : tag_mkenum_headers,
31   header_prefix : '#include <gst/tag/tag-prelude.h>',
32   decorator : 'GST_TAG_API',
33   install_header: true,
34   install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst/tag'))
35 gsttag_c = tag_enums[0]
36 gsttag_h = tag_enums[1]
37 tag_gen_sources = [gsttag_h]
38
39 install_data('license-translations.dict',
40   install_dir : join_paths(get_option('datadir'), 'gst-plugins-base', api_version))
41
42 gst_tag_args = [
43   '-DLICENSE_TRANSLATIONS_PATH="@0@"'.format(
44     join_paths(
45       get_option('prefix'),
46       get_option('datadir'),
47       'gst-plugins-base',
48       api_version,
49       'license-translations.dict'))
50 ]
51
52 # iso-codes (optional, used for language names lookup and translation)
53 have_iso_codes = false
54 iso_codes_dep = dependency('iso-codes', required: get_option('iso-codes'))
55 if iso_codes_dep.found()
56   if iso_codes_dep.get_pkgconfig_variable('domains').split(' ').contains('iso_639-2')
57     iso_codes_prefix = iso_codes_dep.get_pkgconfig_variable('prefix')
58     if iso_codes_prefix != ''
59       core_conf.set_quoted('ISO_CODES_PREFIX', iso_codes_prefix)
60       core_conf.set_quoted('ISO_CODES_VERSION', iso_codes_dep.version())
61       have_iso_codes = true
62     elif get_option('iso-codes').enabled()
63       error('iso-codes was requested for libgsttag, but could not determine prefix')
64     endif
65   elif get_option('iso-codes').enabled()
66     error('iso-codes was requested for libgsttag, but does not provide iso 639')
67   endif
68 endif
69 core_conf.set('HAVE_ISO_CODES', have_iso_codes)
70
71 # could drop optional zlib dep and use g_zlib_decompressor_new()
72 zlib_dep = dependency('zlib', required: false, fallback: ['zlib', 'zlib_dep'])
73 core_conf.set('HAVE_ZLIB', zlib_dep.found())
74
75 tag_deps = [gst_base_dep, libm, zlib_dep]
76 gsttag = library('gsttag-@0@'.format(api_version),
77   tag_sources, gsttag_h, gsttag_c,
78   c_args : gst_plugins_base_args + gst_tag_args,
79   include_directories: [configinc, libsinc],
80   version : libversion,
81   soversion : soversion,
82   darwin_versions : osxversion,
83   install : true,
84   dependencies : tag_deps,
85 )
86
87 if build_gir
88   gst_gir_extra_args = gir_init_section + [ '--c-include=gst/tag/tag.h' ]
89   tag_gen_sources += [gnome.generate_gir(gsttag,
90     sources : tag_sources + tag_headers + [gsttag_h] + [gsttag_c],
91     namespace : 'GstTag',
92     nsversion : api_version,
93     identifier_prefix : 'Gst',
94     symbol_prefix : 'gst',
95     export_packages : 'gstreamer-tag-1.0',
96     includes : ['Gst-1.0', 'GstBase-1.0'],
97     install : true,
98     extra_args : gst_gir_extra_args,
99     dependencies : tag_deps
100   )]
101 endif
102
103 tag_dep = declare_dependency(link_with: gsttag,
104   include_directories : [libsinc],
105   dependencies : tag_deps,
106   sources: tag_gen_sources)
107
108 # Little program that reads iso_639.xml and outputs tables for us as fallback
109 # for when iso-codes are not available (and so we don't have to read the xml
110 # just to map codes)
111 if have_iso_codes
112   executable('mklangtables', 'mklangtables.c',
113     c_args: ['-DHAVE_CONFIG_H'],
114     include_directories: [configinc, libsinc],
115     dependencies: gst_dep,
116     install: false)
117 endif
118
119 executable('mklicensestables', 'mklicensestables.c',
120   c_args : gst_plugins_base_args,
121   include_directories: [configinc],
122   dependencies : [tag_dep, gst_base_dep],
123   install : false)
124
125 gst_tag_dir = meson.current_source_dir()