diff --git a/data/meson.build b/data/meson.build
index 8724dc362208f1f44da3b98b9b77b4701cd4ef6c..32f4a5219bfaed103c17f967d1a7f3f6fc16f498 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -6,7 +6,7 @@ resources = gnome.compile_resources('gen-resources',
                                     'rugby.gresource.xml',
                                     source_dir: 'data')
 
-gnome.compile_schemas(
+compiled_schemas = gnome.compile_schemas(
   build_by_default: true,
   depend_files: 'uk.me.bcowan.Rugby.gschema.xml',
 )
diff --git a/meson.build b/meson.build
index 842783a032e536f0a8139c7bcdda901a9186041e..08fd6fd439d7ad9c54a417eaf0ff36509e6134e8 100644
--- a/meson.build
+++ b/meson.build
@@ -15,15 +15,17 @@ gio_dep = dependency('gio-2.0', version: '>= 2.44')
 gtk_dep = dependency('gtk+-3.0', version: '>= 3.16')
 
 conf = configuration_data()
-
-git = find_program('git', required: false)
-if git.found()
-    VERSION = run_command('git', 'describe', '--always').stdout().strip()
-else
-    VERSION = meson.version()
-endif
-
-conf.set_quoted('VERSION', VERSION)
+conf.set_quoted('VERSION','@VCS_TAG@')
+
+config_h = declare_dependency(
+  sources: vcs_tag(
+    input: configure_file(
+      output: 'config.h.in',
+      configuration: conf
+    ),
+    output: 'config.h',
+  )
+)
 
 cflags = []
 cflags += ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_44',
diff --git a/src/meson.build b/src/meson.build
index ca4bb921d9158510a38c9d732bc01d5c72da9a59..bace1d8c8dc4f85720330b54141ab7cc352515c8 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,4 +1,5 @@
 # SPDX-FileCopyrightText: 2016-2020 Bruce Cowan <bruce@bcowan.me.uk>
+#
 # SPDX-License-Identifier: CC0-1.0
 sources = [
     'main.c',
@@ -9,10 +10,8 @@ sources = [
     'rugby-pref-window.c',
 ]
 
-config_h = configure_file(configuration: conf, output: 'config.h')
-
 executable('rugby',
-           sources, resources, config_h,
-           dependencies: [gio_dep, gtk_dep],
+           sources, resources, compiled_schemas,
+           dependencies: [config_h, gio_dep, gtk_dep],
            install_dir: get_option('bindir'),
            install: true)