[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.410 1.411 cmCTest.cxx 1.356 1.357 cmCacheManager.cxx 1.103 1.104 cmConfigure.cmake.h.in 1.14 1.15 cmDocumentVariables.cxx 1.27 1.28 cmLocalGenerator.cxx 1.296 1.297 cmStandardIncludes.h 1.72 1.73 cmVersion.cxx 1.1028 1.1029 cmVersion.h 1.2 1.3 cmVersionConfig.h.in NONE 1.1 cmVersionMacros.h NONE 1.1 cmake.cxx 1.409 1.410

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Mar 5 15:17:08 EST 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv552/Source

Modified Files:
	CMakeLists.txt cmCTest.cxx cmCacheManager.cxx 
	cmConfigure.cmake.h.in cmDocumentVariables.cxx 
	cmLocalGenerator.cxx cmStandardIncludes.h cmVersion.cxx 
	cmVersion.h cmake.cxx 
Added Files:
	cmVersionConfig.h.in cmVersionMacros.h 
Log Message:
ENH: Overhaul CMake version numbering

This moves the version numbers into an isolated configured header so
that not all of CMake needs to rebuild when the version changes.

Previously we had spaces, dashes and/or the word 'patch' randomly chosen
before the patch number.  Now we always report version numbers in the
traditional format "<major>.<minor>.<patch>[-rc<rc>]".

We still use odd minor numbers for development versions.  Now we also
use the CCYYMMDD date as the patch number of development versions, thus
allowing tests for exact CMake versions.


Index: cmCacheManager.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCacheManager.cxx,v
retrieving revision 1.103
retrieving revision 1.104
diff -C 2 -d -r1.103 -r1.104
*** cmCacheManager.cxx	10 Feb 2009 22:25:20 -0000	1.103
--- cmCacheManager.cxx	5 Mar 2009 20:17:06 -0000	1.104
***************
*** 411,418 ****
                        "Major version of cmake used to create the "
                        "current loaded cache", cmCacheManager::INTERNAL);
! 
!   this->AddCacheEntry("CMAKE_CACHE_RELEASE_VERSION",
!                       cmVersion::GetReleaseVersion().c_str(),
!                       "Major version of cmake used to create the "
                        "current loaded cache", cmCacheManager::INTERNAL);
  
--- 411,417 ----
                        "Major version of cmake used to create the "
                        "current loaded cache", cmCacheManager::INTERNAL);
!   sprintf(temp, "%d", cmVersion::GetPatchVersion());
!   this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION", temp,
!                       "Patch version of cmake used to create the "
                        "current loaded cache", cmCacheManager::INTERNAL);
  

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.296
retrieving revision 1.297
diff -C 2 -d -r1.296 -r1.297
*** cmLocalGenerator.cxx	26 Feb 2009 14:16:15 -0000	1.296
--- cmLocalGenerator.cxx	5 Mar 2009 20:17:06 -0000	1.297
***************
*** 27,30 ****
--- 27,31 ----
  #include "cmSourceFile.h"
  #include "cmTest.h"
+ #include "cmVersion.h"
  #include "cmake.h"
  

Index: cmConfigure.cmake.h.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmConfigure.cmake.h.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -C 2 -d -r1.14 -r1.15
*** cmConfigure.cmake.h.in	27 Feb 2008 21:26:35 -0000	1.14
--- cmConfigure.cmake.h.in	5 Mar 2009 20:17:06 -0000	1.15
***************
*** 25,32 ****
  #define  CMAKE_ROOT_DIR "${CMake_SOURCE_DIR}"
  #define  CMAKE_BUILD_DIR "${CMake_BINARY_DIR}"
- 
- #define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@
- #define CMake_VERSION_MINOR @CMake_VERSION_MINOR@
- #define CMake_VERSION_PATCH @CMake_VERSION_PATCH@
- #cmakedefine CMake_VERSION_RC @CMake_VERSION_RC@
  #define CMAKE_DATA_DIR "@CMAKE_DATA_DIR@"
--- 25,27 ----

--- NEW FILE: cmVersionMacros.h ---
/*=========================================================================

  Program:   CMake - Cross-Platform Makefile Generator
  Module:    $RCSfile: cmVersionMacros.h,v $
  Language:  C++
  Date:      $Date: 2009-03-05 20:17:06 $
  Version:   $Revision: 1.1 $

  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmVersionMacros_h
#define cmVersionMacros_h

#include "cmVersionConfig.h"

#define CMAKE_TO_STRING(x) CMAKE_TO_STRING0(x)
#define CMAKE_TO_STRING0(x) #x

#define CMake_VERSION                      \
  CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
  CMAKE_TO_STRING(CMake_VERSION_MINOR)

#define CMake_VERSION_FULL \
  CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
  CMAKE_TO_STRING(CMake_VERSION_MINOR) "." \
  CMAKE_TO_STRING(CMake_VERSION_PATCH)

#if !(CMake_VERSION_MINOR & 1) && defined(CMake_VERSION_RC)
# define CMake_VERSION_RC_SUFFIX "-rc" CMAKE_TO_STRING(CMake_VERSION_RC)
#else
# define CMake_VERSION_RC_SUFFIX ""
#endif

#endif

--- NEW FILE: cmVersionConfig.h.in ---
/*=========================================================================

  Program:   CMake - Cross-Platform Makefile Generator
  Module:    $RCSfile: cmVersionConfig.h.in,v $
  Language:  C++
  Date:      $Date: 2009-03-05 20:17:06 $
  Version:   $Revision: 1.1 $

  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@
#define CMake_VERSION_MINOR @CMake_VERSION_MINOR@
#define CMake_VERSION_PATCH @CMake_VERSION_PATCH@
#cmakedefine CMake_VERSION_RC @CMake_VERSION_RC@

Index: cmVersion.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVersion.cxx,v
retrieving revision 1.1028
retrieving revision 1.1029
diff -C 2 -d -r1.1028 -r1.1029
*** cmVersion.cxx	13 Jun 2008 14:15:13 -0000	1.1028
--- cmVersion.cxx	5 Mar 2009 20:17:06 -0000	1.1029
***************
*** 17,42 ****
  #include "cmVersion.h"
  
! #include <cmsys/DateStamp.h>
  
! std::string cmVersion::GetReleaseVersion()
! {
! #if CMake_VERSION_MINOR & 1
!   return cmsys_DATE_STAMP_STRING_FULL;
! #else
! # ifdef CMake_VERSION_RC
!   return "patch " CMAKE_TO_STRING(CMake_VERSION_PATCH) " RC-" 
!     CMAKE_TO_STRING(CMake_VERSION_RC);
! # else
!   return "patch " CMAKE_TO_STRING(CMake_VERSION_PATCH);
! # endif  
! #endif
! }
  
! std::string cmVersion::GetCMakeVersion()
  {
!   cmOStringStream str;
!   str << CMake_VERSION_MAJOR << "." << CMake_VERSION_MINOR
!     << "-"
!     << cmVersion::GetReleaseVersion();
!   return str.str();
  }
--- 17,28 ----
  #include "cmVersion.h"
  
! #include "cmVersionMacros.h"
  
! unsigned int cmVersion::GetMajorVersion() { return CMake_VERSION_MAJOR; }
! unsigned int cmVersion::GetMinorVersion() { return CMake_VERSION_MINOR; }
! unsigned int cmVersion::GetPatchVersion() { return CMake_VERSION_PATCH; }
  
! const char* cmVersion::GetCMakeVersion()
  {
!   return CMake_VERSION_FULL CMake_VERSION_RC_SUFFIX;
  }

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.409
retrieving revision 1.410
diff -C 2 -d -r1.409 -r1.410
*** cmake.cxx	5 Mar 2009 18:57:10 -0000	1.409
--- cmake.cxx	5 Mar 2009 20:17:06 -0000	1.410
***************
*** 2356,2362 ****
    const char *full;
    char tmp[1024];
!   sprintf(tmp,"Version %d.%d (%s)", cmVersion::GetMajorVersion(),
!           cmVersion::GetMinorVersion(),
!           cmVersion::GetReleaseVersion().c_str());
    f << "<html>\n";
    f << "<h1>Documentation for commands of CMake " << tmp << "</h1>\n";
--- 2356,2360 ----
    const char *full;
    char tmp[1024];
!   sprintf(tmp,"Version %s", cmVersion::GetCMakeVersion());
    f << "<html>\n";
    f << "<h1>Documentation for commands of CMake " << tmp << "</h1>\n";

Index: cmDocumentVariables.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentVariables.cxx,v
retrieving revision 1.27
retrieving revision 1.28
diff -C 2 -d -r1.27 -r1.28
*** cmDocumentVariables.cxx	25 Feb 2009 16:44:46 -0000	1.27
--- cmDocumentVariables.cxx	5 Mar 2009 20:17:06 -0000	1.28
***************
*** 111,117 ****
    
    cm->DefineProperty
!     ("CMAKE_CACHE_RELEASE_VERSION", cmProperty::VARIABLE,
!      "Release version of CMake used to create the CMakeCache.txt file",
!      "This is stores the release version of CMake used to "
       "write a CMake cache file. It is only different when "
       "a different version of CMake is run on a previously "
--- 111,117 ----
    
    cm->DefineProperty
!     ("CMAKE_CACHE_PATCH_VERSION", cmProperty::VARIABLE,
!      "Patch version of CMake used to create the CMakeCache.txt file",
!      "This is stores the patch version of CMake used to "
       "write a CMake cache file. It is only different when "
       "a different version of CMake is run on a previously "

Index: cmCTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCTest.cxx,v
retrieving revision 1.356
retrieving revision 1.357
diff -C 2 -d -r1.356 -r1.357
*** cmCTest.cxx	24 Feb 2009 20:43:06 -0000	1.356
--- cmCTest.cxx	5 Mar 2009 20:17:06 -0000	1.357
***************
*** 27,30 ****
--- 27,31 ----
  #include "cmGeneratedFileStream.h"
  #include "cmXMLSafe.h"
+ #include "cmVersionMacros.h"
  #include "cmCTestCommand.h"
  
***************
*** 1267,1271 ****
         << "\"\n\tBuildStamp=\"" << this->CurrentTag << "-"
         << this->GetTestModelString() << "\"\n\tName=\""
!        << this->GetCTestConfiguration("Site") << "\"\n\tGenerator=\"ctest"
         << cmVersion::GetCMakeVersion()  << "\"\n"
         << (append? "\tAppend=\"true\"\n":"")
--- 1268,1272 ----
         << "\"\n\tBuildStamp=\"" << this->CurrentTag << "-"
         << this->GetTestModelString() << "\"\n\tName=\""
!        << this->GetCTestConfiguration("Site") << "\"\n\tGenerator=\"ctest-"
         << cmVersion::GetCMakeVersion()  << "\"\n"
         << (append? "\tAppend=\"true\"\n":"")

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CMakeLists.txt,v
retrieving revision 1.410
retrieving revision 1.411
diff -C 2 -d -r1.410 -r1.411
*** CMakeLists.txt	24 Feb 2009 15:40:17 -0000	1.410
--- CMakeLists.txt	5 Mar 2009 20:17:06 -0000	1.411
***************
*** 14,17 ****
--- 14,21 ----
    )
  CONFIGURE_FILE(
+   "${CMake_SOURCE_DIR}/Source/cmVersionConfig.h.in"
+   "${CMake_BINARY_DIR}/Source/cmVersionConfig.h"
+   )
+ CONFIGURE_FILE(
    "${CMake_SOURCE_DIR}/Source/CPack/cmCPackConfigure.h.in"
    "${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h"

Index: cmStandardIncludes.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmStandardIncludes.h,v
retrieving revision 1.72
retrieving revision 1.73
diff -C 2 -d -r1.72 -r1.73
*** cmStandardIncludes.h	24 Feb 2008 19:05:11 -0000	1.72
--- cmStandardIncludes.h	5 Mar 2009 20:17:06 -0000	1.73
***************
*** 22,28 ****
  #define cmStandardIncludes_h
  
- #define CMAKE_TO_STRING(x) CMAKE_TO_STRING0(x)
- #define CMAKE_TO_STRING0(x) #x
- 
  // include configure generated  header to define CMAKE_NO_ANSI_STREAM_HEADERS,
  // CMAKE_NO_STD_NAMESPACE, and other macros.
--- 22,25 ----
***************
*** 30,45 ****
  #include <cmsys/Configure.hxx>
  
- #define CMake_VERSION \
-   CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
-   CMAKE_TO_STRING(CMake_VERSION_MINOR)
- 
- #define CMake_VERSION_FULL \
-   CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
-   CMAKE_TO_STRING(CMake_VERSION_MINOR) "." \
-   CMAKE_TO_STRING(CMake_VERSION_PATCH)
- 
- #define CMake_VERSION_ENCODE(major, minor, patch) \
-   ((major)*0x10000u + (minor)*0x100u + (patch))
- 
  #ifdef _MSC_VER
  #pragma warning ( disable : 4786 )
--- 27,30 ----

Index: cmVersion.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVersion.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C 2 -d -r1.2 -r1.3
*** cmVersion.h	17 Jun 2005 13:49:06 -0000	1.2
--- cmVersion.h	5 Mar 2009 20:17:06 -0000	1.3
***************
*** 31,41 ****
     * Return major and minor version numbers for cmake.
     */
!   static unsigned int GetMajorVersion() { return CMake_VERSION_MAJOR; }
!   static unsigned int GetMinorVersion() { return CMake_VERSION_MINOR; }
!   static unsigned int GetPatchVersion() { return CMake_VERSION_PATCH; }
!   static std::string GetReleaseVersion();
!   static std::string GetCMakeVersion();
  };
  
  #endif
  
--- 31,43 ----
     * Return major and minor version numbers for cmake.
     */
!   static unsigned int GetMajorVersion();
!   static unsigned int GetMinorVersion();
!   static unsigned int GetPatchVersion();
!   static const char* GetCMakeVersion();
  };
  
+ #define CMake_VERSION_ENCODE(major, minor, patch) \
+   ((major)*0x10000u + (minor)*0x100u + (patch))
+ 
  #endif
  



More information about the Cmake-commits mailing list