Commit 041b64b9 authored by Emmanuele Bassi's avatar Emmanuele Bassi

Merge branch 'gtk3-meson-use-cups-dep-type' into 'gtk-3-24'

meson: use cups-config for looking up cups

See merge request GNOME/gtk!963
parents afc31c47 dab769a0
......@@ -69,38 +69,21 @@ if enabled_print_backends.contains('cloudprint')
endif
if enabled_print_backends.contains('cups')
cups_error = ''
if cc.has_header('cups/cups.h')
cups_major_version = cc.compute_int('CUPS_VERSION_MAJOR', prefix : '#include <cups/cups.h>')
cups_minor_version = cc.compute_int('CUPS_VERSION_MINOR', prefix : '#include <cups/cups.h>')
cups_version = '@0@.@1@'.format(cups_major_version, cups_minor_version)
message('Found CUPS version: @0@'.format(cups_version))
if cups_version.version_compare('<1.7')
cups_error = 'Need CUPS version >= 1.7'
else
libcups = cc.find_library('cups', required : true)
cups_dep = dependency('cups', version : '>=1.7', required: print_strict_deps)
if cups_dep.found()
cups_extra_deps = []
enable_colord = get_option('colord')
if enable_colord != 'no'
want_colord = enable_colord == 'yes'
colord_dep = dependency('colord', version: '>= 0.1.9', required: want_colord)
cdata.set('HAVE_COLORD', colord_dep.found() ? 1 : false)
cups_extra_deps += [colord_dep]
endif
else
cups_error = 'Cannot find CUPS headers in default prefix.'
endif
enable_colord = get_option('colord')
if enable_colord != 'no'
want_colord = enable_colord == 'yes'
colord_dep = dependency('colord', version: '>= 0.1.9', required: want_colord)
cdata.set('HAVE_COLORD', colord_dep.found() ? 1 : false)
else
cups_colord_dep = []
endif
if cups_error != ''
if print_strict_deps
error(cups_error)
else
message(cups_error)
endif
else
print_backends += ['cups']
else
message('\'cups\' backend disabled: missing dependencies')
endif
endif
......@@ -168,7 +151,7 @@ if print_backends.contains('cups')
'cups/gtkcupsutils.c',
'cups/gtkcupssecretsutils.c',
c_args: printbackends_args,
dependencies: [libgtk_dep, libcups, colord_dep],
dependencies: [libgtk_dep, cups_dep] + cups_extra_deps,
install_dir: printbackends_install_dir,
install : true)
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment