On 06/05/2011 05:02 AM, Quintus wrote: > I'm working on a git-versioned project that I'd like to display it's > version number for development versions like this: > > 1.2.3-dev (commit abc1234 on devel, 12/4/10)
FYI, consider using "git describe" for versions. > CMake's FindGit module seems to be quite limited as it just gives me the > path to git's executable file, leaving it on me to invoke the necessary > EXECUTE_PROCESS() commands to find the current git branch and commit. Most Find* modules provide only the basic search results. A few of them try to provide some kind of API to simplify use of the package. This saves a lot of boilerplate CMake code in cases that the same thing appears in many projects. Since Git is so flexible and has so many different ways to work I'm not convinced it makes sense in this case. However, I think getting the current branch will be a fairly common use case. > Inspired by this, I wrote another function to get the current branch: I think the proper way to do this is actually git symbolic-ref -q HEAD which prints out "refs/heads/$branch" or returns non-zero in the case of a detached head. This uses git's plumbing which is meant for machine consumption and will always have a stable API. > Any chance to get this and the function from the evemu project into > official CMake's FindGit.cmake? Our policy for module contributions is documented here: http://www.cmake.org/Wiki/CMake:Module_Maintainers > I'm not sure about their license, but the sourcecode seems to be > licensed under LGPL That is not compatible with CMake's OSI-approved BSD license. -Brad _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake