STYLE: Nightly Version update
[cmake.git] / Source / cmVersion.cxx
blobc255c18ae0be3ef6b2b0db1ee1ef2cbbea80f5b6
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmVersion.cxx,v $
5 Language: C++
6 Date: $Date: 2007-05-01 08:20:03 $
7 Version: $Revision: 1.845 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmVersion.h"
19 std::string cmVersion::GetReleaseVersion()
21 #if CMake_VERSION_MINOR & 1
22 std::string cver = "$Date: 2007-05-01 08:20:03 $";
23 std::string res = "";
24 std::string::size_type cc, len = cver.size();
25 bool aftercol = false;
26 int cnt = 0;
27 for ( cc = 0; cc < len; cc ++ )
29 if ( aftercol )
31 char ch = cver[cc];
32 switch ( ch )
34 case ' ':
35 case ':':
36 case '/':
37 case '-':
38 case '$':
39 break;
40 default:
41 res += ch;
42 cnt ++;
44 if ( cnt >= 8 )
46 return res;
49 else
51 if ( cver[cc] == ':' )
53 aftercol = true;
57 return res;
58 #else
59 # if CMake_VERSION_PATCH == 1
60 return "1-beta";
61 # else
62 # ifdef CMake_VERSION_RC
63 return "patch " CMAKE_TO_STRING(CMake_VERSION_PATCH) " RC-"
64 CMAKE_TO_STRING(CMake_VERSION_RC);
65 # else
66 return "patch " CMAKE_TO_STRING(CMake_VERSION_PATCH);
67 # endif
68 # endif
69 #endif
72 std::string cmVersion::GetCMakeVersion()
74 cmOStringStream str;
75 str << CMake_VERSION_MAJOR << "." << CMake_VERSION_MINOR
76 << "-"
77 << cmVersion::GetReleaseVersion();
78 return str.str();