aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/VersionFromVCS.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Don't run 'git svn' if there is no .git/svn directory.Jim Grosbach2012-12-101-40/+42
| | | | | | | If the local checkout does not have 'git svn' references set up, don't try to use 'git svn' for version information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169749 91177308-0d34-0410-b5e6-96231b3b80d8
* cmake: work with CMake < 2.8.5Dylan Noblesmith2011-12-121-1/+3
| | | | | | | | | | | CMake versions 2.8.4 and earlier were giving this error since r146323: "string end index: -1 is out of range 0 - 6" Passing -1 as the length of the desired substring was a new feature added in CMake 2.8.5: http://www.cmake.org/Bug/view.php?id=10740 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146372 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a simpler and more reliable command for converting from HEAD toChandler Carruth2011-12-101-1/+1
| | | | | | commit-ish. Funny thing, they have a command designed for this. ;] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146325 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the VCS detection to set some root-level variables with the rawChandler Carruth2011-12-101-0/+3
| | | | | | | revision and git commit data extracted. This will be used in the Clang CMake build to avoid trying to re-detect the information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146324 91177308-0d34-0410-b5e6-96231b3b80d8
* At the request of Michael Spencer, make the VCS version detection logicChandler Carruth2011-12-101-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't try to guess svn version when current path is a symlink.Oscar Fuentes2010-10-221-2/+5
| | | | | | See PR 8473. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117109 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Use the svn revision information from git-svn if available.Michael J. Spencer2010-09-081-7/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113405 91177308-0d34-0410-b5e6-96231b3b80d8
* When building from git, add ref-id to PACKAGE_VERSIONOscar Fuentes2010-08-051-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110301 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: add version control info to PACKAGE_VERSION, if available.Oscar Fuentes2010-08-031-0/+20
Adds "svn" or "git", depending on the VCS used. If svn, adds the revision number as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110121 91177308-0d34-0410-b5e6-96231b3b80d8