From b817bcec6b5377fef0717d39348a173b7157a91b Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Fri, 18 Jan 2019 11:59:40 +0000 Subject: libcamera: Auto generate version information Generate a version string, and provide a global string object which allows applications to interrogate the current libcamera version information. The version header is automatically updated by meson on each build. The string roughly follows the semver [0] conventions of major.minor.patch-label as a value. [0] https://semver.org/ A script (utils/gen-version.sh) is provided which is modelled upon the processing from autoconf's git-version-gen. The gen-version.sh script will look for tags in the form vX.Y as starting points for the version string. While the repository does not have any matching tags, v0.0 will be assumed, resulting in versions with both major and minor being set to '0', and the patch count resulting from the number of patches in the history to that point. Finally, a uniquely identifying shortened hash is provided from git: v0.0.509+0ec0edf7 Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- meson.build | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index a3b0bc82..342b3cc7 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,8 @@ project('libcamera', 'c', 'cpp', meson_version : '>= 0.40', - version : '0.1', + version : run_command('utils/gen-version.sh', + '@0@'.format(meson.source_root()), + check : true).stdout().strip(), default_options : [ 'werror=true', 'warning_level=2', @@ -8,11 +10,6 @@ project('libcamera', 'c', 'cpp', ], license : 'LGPL 2.1+') -# TODO: Extract this from project.version. -# Ideally the version at Documentation/conf.py should be -# generated from this too. -api_version = '0.1' - cc = meson.get_compiler('c') config_h = configuration_data() -- cgit v1.2.1