[cmake-developers] added get_git_revision and get_git_branch commands as follow-up to cmake at cmake.org

Ben Boeckel ben.boeckel at kitware.com
Thu Oct 8 11:54:38 EDT 2015


On Thu, Oct 08, 2015 at 17:16:33 +0200, Daniel Wirtz wrote:
> @ben / "I honestly don't think configure time git information is all 
> that useful anyways"
> in our scenario, the configure time information is actually more 
> relevant. we use the "superbuild" scheme and also provide
> a "support" target that collects configuration info and variables if 
> something goes wrong during builds. therein, the git information is 
> crucial for us
> if we want to track down the errors they encounter.
> of course, this doesn't mean the build-time info is irrelevant.

OK, that info is useful there, but *those* results should not end up in
the build itself. The documentation needs to be clear about this.

> @ben / "support for SVN, Mercurial and others"
> so are we talking about a "GetCVSInfo"-type module here? if so, i think 
> this will quickly grow too big and tedious to handle.

No, just that you could say any of:

    configure_revision_info(git "${source}" "${dest}")
    configure_revision_info(cvs "${source}" "${dest}")
    configure_revision_info(hg "${source}" "${dest}")

and then the generated file does:

    include("RevisionExtract_${source_control}")

so that other source control systems can have "get relevant info"
modules to run at build time rather than baking git magic into the file
directly.

--Ben


More information about the cmake-developers mailing list