llvm-6502/cmake/modules
Chandler Carruth 1f8bd3057e At the request of Michael Spencer, make the VCS version detection logic
in CMake a bit more handy. Previously we would get such charming
versions as the following for revision NNNN and commit-ish XXXXX:
  3.1svnsvn-rNNNN
  3.1svngit-svn-rNNNN
  3.1svngit-svn-XXXXX

The mechanism selecting betwene the latter two was particularly odd, and
didn't work with all of the ways git-svn repos are set up apparently. It
also misses an important point -- both the revision *and* the git commit
might be relevant when working on a local branch some distance from
mainline. The new logic does several things:

1) It strips the redundant initial 'svn'.
2) It always looks for a git-svn revision number base, and when found
   includes it in the version.
3) If the git commit-ish for the current HEAD is not exactly that
   revision number, it is also included.

The resulting strings should roughly be:
  3.1svn-rNNNN
  3.1git-svn-rNNNN
  3.1git-svn-rNNNN-XXXXX

Suggestions on formatting etc always welcome. =] I've only looked at the
LLVM version string here, not Clang's (yet).

Note that the commit-ish reported is *not* terribly accurate. It updates
when 'cmake' is run, not when the binary is built. Still, it may be
better than nothing, especially if people have fairly long-lived git
repos and branches. This is not a new limitation, just didn't want
anyone to be surprised.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146323 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-10 09:41:13 +00:00
..
AddLLVM.cmake build/CMake: Finish removal of add_llvm_library_dependencies. 2011-11-29 19:25:30 +00:00
AddLLVMDefinitions.cmake cmake/*: Add svn:eol-style=native and fix CRLF. 2011-02-03 11:41:27 +00:00
CheckAtomic.cmake Rename LLVM_MULTITHREADED define and fix build without threads. 2011-09-19 20:43:23 +00:00
ChooseMSVCCRT.cmake Fix CRT selection logic when using CMake NMake generator. 2011-11-06 23:37:22 +00:00
CMakeLists.txt build/cmake: Switch to using llvm-build computed dependencies. 2011-11-29 01:31:52 +00:00
GetTargetTriple.cmake GetTargetTriple.cmake: detect MinGW 64 bits. 2010-10-13 20:15:08 +00:00
HandleLLVMOptions.cmake build/cmake: Move all the user controllable options into top-level CMakeLists 2011-11-04 19:04:35 +00:00
LLVM-Config.cmake build/cmake: Switch to using llvm-build computed dependencies. 2011-11-29 01:31:52 +00:00
LLVMConfig.cmake.in Make my attempt to build up global deps variables actually utilize 2011-07-29 23:52:01 +00:00
LLVMConfigVersion.cmake.in CMake: support for using LLVM from client projects with find_package. 2011-04-10 16:17:49 +00:00
LLVMParseArguments.cmake Add the PARSE_ARGUMENTS CMake macro to LLVM so I can use it to clean 2011-02-19 18:01:15 +00:00
LLVMProcessSources.cmake Handle gcc-compatible compilers (such as clang) the same way we handle 2011-05-11 13:53:08 +00:00
TableGen.cmake Fix a typo noticed by Peter Collingbourne. No one depends on this 2011-11-02 16:55:57 +00:00
VersionFromVCS.cmake At the request of Michael Spencer, make the VCS version detection logic 2011-12-10 09:41:13 +00:00