diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-04-04 14:25:52 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-04-04 14:46:48 -0400 |
commit | 35c4428083ddf80e67af33b959f845c593945dbc (patch) | |
tree | c192193920db057990ba419195ffe23a49ba18f9 /meson.build | |
parent | bae1fe254a0f730a82cd14dfd3deab06c753a8c7 (diff) |
meson: Add bash completion support
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/meson.build b/meson.build index e7d219b8d..a7567923a 100644 --- a/meson.build +++ b/meson.build @@ -27,7 +27,7 @@ prefix = get_option('prefix') libtype = get_option('library_format') libexecdir = get_option('libexecdir') -helpers_install_dir = libexecdir + '/gstreamer-1.0/' +helpers_install_dir = join_paths(libexecdir, 'gstreamer-1.0') cc = meson.get_compiler('c') @@ -375,6 +375,41 @@ if not py3.found() py3 = find_program('python') endif +bashcomp_dep = dependency('bash-completion', version : '>= 2.0', required : false) + +bashcomp_found = bashcomp_dep.found() +bash_completions_dir = '' +bash_helpers_dir = '' + +if bashcomp_found + # get_pkgconfig_variable() won't let us set the prefix + pkgconfig = find_program('pkg-config') + + runcmd = run_command(pkgconfig, + '--define-variable=prefix="."', + '--variable=completionsdir', + 'bash-completion') + + if (runcmd.returncode() == 0) + bash_completions_dir = runcmd.stdout().strip() + else + message('Found bash-completion but the .pc file did not set \'completionsdir\'.') + bashcomp_found = false + endif + + runcmd = run_command(pkgconfig, + '--define-variable=prefix="."', + '--variable=helpersdir', + 'bash-completion') + + if (runcmd.returncode() == 0) + bash_helpers_dir = runcmd.stdout().strip() + else + message('Found bash-completion, but the .pc file did not set \'helpersdir\'.') + bashcomp_found = false + endif +endif + subdir('gst') subdir('libs') subdir('plugins') @@ -382,6 +417,7 @@ subdir('tools') subdir('pkgconfig') subdir('tests') subdir('po') +subdir('data') if build_machine.system() == 'windows' message('Disabling gtk-doc while building on Windows') |