[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 10:37:45 EDT 2015


On Thu, Oct 08, 2015 at 13:10:54 +0000, Ryan Pavlik wrote:
> One addition I would have liked to have but haven't had time to do yet: the
> ability to have a add custom command-based build time generation, instead
> of our in addition to the CMake time generation. Some projects take a very
> long time to generate, may cause visual studio to needlessly reload project
> files, and you may only want the revision for a header file anyway. As you
> can imagine, this would share much implementation with the configure time
> code, and the prerequisite refactoring is why I haven't gotten around to
> doing it yet.

FYI, this is what sprokit's code does (based on
sprokit_configure_file[1]). I honestly don't think configure time git
information is all that useful anyways, so build-time generation is the
only way sprokit does it (and it handles tarball builds just fine too).

--Ben

[1]https://github.com/Kitware/sprokit/blob/master/conf/sprokit-macro-configure.cmake#L73


More information about the cmake-developers mailing list