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 --- Documentation/conf.py | 7 ++----- Documentation/meson.build | 7 +++++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'Documentation') diff --git a/Documentation/conf.py b/Documentation/conf.py index 970edf3d..bffd1d8f 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -23,11 +23,8 @@ project = 'libcamera' copyright = '2018-2019, The libcamera documentation authors' author = u'Kieran Bingham, Jacopo Mondi, Laurent Pinchart, Niklas Söderlund' -# The short X.Y version -version = '' -# The full version, including alpha/beta/rc tags -release = '0.1' - +# Version information is provided by the build environment, through the +# sphinx command line. # -- General configuration --------------------------------------------------- diff --git a/Documentation/meson.build b/Documentation/meson.build index 629e8531..2db80b39 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -1,4 +1,4 @@ -doc_install_dir = join_paths(get_option('datadir'), 'doc', 'libcamera-@0@'.format(api_version)) +doc_install_dir = join_paths(get_option('datadir'), 'doc', 'libcamera-@0@'.format(meson.project_version())) # # Doxygen @@ -47,8 +47,11 @@ if sphinx.found() 'index.rst', ] + release = 'release=' + meson.project_version() + custom_target('documentation', - command : [sphinx, '-q', '-W', '-b', 'html', meson.current_source_dir(), '@OUTPUT@'], + command : [sphinx, '-D', release, '-q', '-W', '-b', 'html', + meson.current_source_dir(), '@OUTPUT@'], input : docs_sources, output : 'html', build_by_default : true, -- cgit v1.2.1