gstreamer/ext/openjpeg/meson.build
Clemens Lang 15f24fef53 openjpeg: Fix build against openjpeg 2.2
OpenJPEG 2.2 has some API changes and thus ships its headers in a new
include path. Add a configure check (to both meson and autoconf) to
detect the newer version of OpenJPEG and add conditional includes.

Fix the autoconf test for OpenJPEG 2.1, which checked for HAVE_OPENJPEG,
which was always set even for 2.0.

https://bugzilla.gnome.org/show_bug.cgi?id=786250
2017-08-14 10:25:07 +03:00

39 lines
1 KiB
Meson

openjpeg_sources = [
'gstopenjpeg.c',
'gstopenjpegdec.c',
'gstopenjpegenc.c',
]
openjpeg_cargs = []
# Check for 2.2, 2.1, then 2.0
openjpeg_dep = dependency('libopenjp2', version : '>=2.2', required : false)
if openjpeg_dep.found()
openjpeg_cargs += ['-DHAVE_OPENJPEG_2_2']
else
openjpeg_dep = dependency('libopenjp2', version : '>=2.1', required : false)
if openjpeg_dep.found()
openjpeg_cargs += ['-DHAVE_OPENJPEG_2_1']
else
openjpeg_dep = dependency('libopenjp2', required : false)
# Fallback to 1.5
if not openjpeg_dep.found()
openjpeg_dep = dependency('libopenjpeg1', required : false)
openjpeg_cargs += ['-DHAVE_OPENJPEG_1']
endif
endif
endif
if openjpeg_dep.found()
gstopenjpeg = library('gstopenjpeg',
openjpeg_sources,
c_args : gst_plugins_bad_args + openjpeg_cargs,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gst_dep, gstvideo_dep, openjpeg_dep,
gstcodecparsers_dep],
install : true,
install_dir : plugins_install_dir,
)
endif