This output could be sourced or run directly inside a POSIX shell to acquire usable shell variables from a binary by running it with --version.
. <(./FooCXX --version) # 'source' the version output of the program
echo $CommitHash
echo $Project
echo $Version
> 3898f357430934cb9a1dea5f85832304ee302137
> Test_CMakeVersionInfoTarget_Lang_C
> 1.2.3.4
Maybe changing the value of the generated VersionSummary variable isn't wise, but instead adding a second generated variable like VersionSummaryFull that contains all the version info in the VAR=VAL format?
Perhaps the generated
VersionSummary
variable should be formatted with=
signs instead of:
Right now it prints like this:
But perhaps it could be like this?
This output could be sourced or run directly inside a POSIX shell to acquire usable shell variables from a binary by running it with
--version
.Maybe changing the value of the generated
VersionSummary
variable isn't wise, but instead adding a second generated variable likeVersionSummaryFull
that contains all the version info in the VAR=VAL format?