meson: use dep.get_pkgconfig_variable()
authorTim-Philipp Müller <tim@centricular.com>
Mon, 5 Jun 2017 22:57:48 +0000 (23:57 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 5 Jun 2017 22:57:48 +0000 (23:57 +0100)
instead of calling pkg-config ourselves.

ext/libvisual/meson.build
meson.build

index 1974751..5cc59b1 100644 (file)
@@ -5,13 +5,9 @@ libvisual_sources = [
 
 libvisual_dep = dependency('libvisual-0.4', version : '>= 0.4.0', required : false)
 if libvisual_dep.found()
-  runcmd = run_command('pkg-config', '--variable=pluginsbasedir', 'libvisual-0.4')
-  if runcmd.returncode() == 0
-    core_conf.set('LIBVISUAL_PLUGINSBASEDIR', '"@0@"'.format(runcmd.stdout().strip()))
-  endif
-endif
+  core_conf.set_quoted('LIBVISUAL_PLUGINSBASEDIR',
+    libvisual_dep.get_pkgconfig_variable('pluginsbasedir'))
 
-if libvisual_dep.found()
   gstlibvisual = library('gstlibvisual',
     libvisual_sources,
     c_args : gst_plugins_base_args,
index f48efe8..d55f841 100644 (file)
@@ -143,18 +143,12 @@ gio_dep = dependency('gio-2.0', version : glib_req)
 core_conf.set('HAVE_X', x11_dep.found())
 core_conf.set('HAVE_GIO_UNIX_2_0', giounix_dep.found())
 
-runcmd = run_command('pkg-config', '--variable=giomoduledir', 'gio-2.0')
-if runcmd.returncode() == 0
-  core_conf.set('GIO_MODULE_DIR', '"@0@"'.format(runcmd.stdout().strip()))
-endif
-runcmd = run_command('pkg-config', '--variable=libdir', 'gio-2.0')
-if runcmd.returncode() == 0
-  core_conf.set('GIO_LIBDIR', '"@0@"'.format(runcmd.stdout().strip()))
-endif
-runcmd = run_command('pkg-config', '--variable=prefix', 'gio-2.0')
-if runcmd.returncode() == 0
-  core_conf.set('GIO_PREFIX', '"@0@"'.format(runcmd.stdout().strip()))
-endif
+core_conf.set_quoted('GIO_MODULE_DIR',
+  gio_dep.get_pkgconfig_variable('giomoduledir'))
+core_conf.set_quoted('GIO_LIBDIR',
+  gio_dep.get_pkgconfig_variable('libdir'))
+core_conf.set_quoted('GIO_PREFIX',
+  gio_dep.get_pkgconfig_variable('prefix'))
 
 configinc = include_directories('.')
 libsinc = include_directories('gst-libs')