diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2017-09-11 20:49:34 +0200 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2017-09-11 20:58:49 +0200 |
commit | eb627bf5a92aa8491ac6d9f99049b2215c0ffbb5 (patch) | |
tree | e13c926a0bbc0930c6745891ae236993d745253c | |
parent | 332ddab435dd49eacace7d882a08c6edb61d301a (diff) | |
download | gnome-contacts-eb627bf5a92aa8491ac6d9f99049b2215c0ffbb5.tar.gz |
Meson: allow 'auto' value for `with-cheese`.
This brings the options up par with the autotools build.
-rw-r--r-- | man/meson.build | 2 | ||||
-rw-r--r-- | meson.build | 15 | ||||
-rw-r--r-- | meson_options.txt | 2 | ||||
-rw-r--r-- | src/meson.build | 2 |
4 files changed, 13 insertions, 8 deletions
diff --git a/man/meson.build b/man/meson.build index 2912cca..ec4c022 100644 --- a/man/meson.build +++ b/man/meson.build @@ -1,4 +1,4 @@ -if get_option('with-manpage') +if manpage_enabled xsltproc = find_program('xsltproc') custom_target('manfile-gnome-contacts', input: 'gnome-contacts.xml', diff --git a/meson.build b/meson.build index 3e87eef..d996aaa 100644 --- a/meson.build +++ b/meson.build @@ -43,14 +43,19 @@ libedataserver = dependency('libedataserver-1.2', version: '>=' + min_eds_versio libedataserverui = dependency('libedataserverui-1.2', version: '>=' + min_eds_version) telepathy_glib = dependency('telepathy-glib', version: '>= 0.22.0') -if get_option('with-cheese') - cheese = dependency('cheese') - cheese_gtk = dependency('cheese-gtk', version: '>= 3.3.91') -endif - # Libraries math = meson.get_compiler('c').find_library('m') +# Options +cheese_enabled = (get_option('with-cheese') != 'no') +if cheese_enabled + cheese = dependency('cheese', required: cheese_enabled) + cheese_gtk = dependency('cheese-gtk', version: '>= 3.3.91', required: cheese_enabled) + cheese_enabled = cheese.found() and cheese_gtk.found() +endif + +manpage_enabled = get_option('with-manpage') + # Configuration conf = configuration_data() conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) diff --git a/meson_options.txt b/meson_options.txt index d8d3bf2..040299d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,2 @@ -option('with-cheese', type: 'boolean', value: true, description: 'enable cheese webcam support') +option('with-cheese', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'enable cheese webcam support') option('with-manpage', type: 'boolean', value: true, description: 'enable building man pages') diff --git a/src/meson.build b/src/meson.build index e7f9c77..0bb6638 100644 --- a/src/meson.build +++ b/src/meson.build @@ -72,7 +72,7 @@ contacts_deps = [ ] # Add extra stuff if cheese is enabled -if get_option('with-cheese') +if cheese_enabled contacts_deps += [ cheese, cheese_gtk ] contacts_vala_args += [ '-D', 'HAVE_CHEESE' ] contacts_c_sources += 'cheese-flash.c' |