BitShares/bitshares_toolkit — pull request #764 by drltc (2014-09-11 08:18:11+00:00)
Title: Add bitshares_toolkit_version to about RPC and --version command line

This patch fixes a simple bug: When running the client with the `--version` command line option, the version is not displayed! Only a hex git revision hash is shown.

The problem is non-trivial, because while the repository of downstream chain provider dacsunlimited has numbered version releases, this repository does not. Furthermore, we may eventually wish to support other downstream chain providers who might want to have their own wildly different versioning schemes.

This patch uses the following algorithm to come up with a meaningful version number while taking the above considerations into account:

- If the current commit is tagged, then the tag name becomes the version string.
- Else if we are N commits past the last tag T, then the version number is equal to $T-$N-g$H where H is the first few characters of the current commit hash.
- Else the version string is "unknown".

Except for the final `else` case, all of that logic is actually implemented by `git describe --tags`, which this patch calls through a built-in cmake wrapper function.