[cmake-commits] hoffman committed cmCMakeMinimumRequired.cxx 1.11 1.12 cmCPluginAPI.cxx 1.31 1.32 cmCacheManager.cxx 1.94 1.95 cmGlobalGenerator.cxx 1.163 1.164 cmLocalGenerator.cxx 1.164 1.165 cmLocalUnixMakefileGenerator3.cxx 1.183 1.184 cmMakefile.cxx 1.366 1.367 cmMakefile.h 1.196 1.197 cmake.cxx 1.273 1.274 cmake.h 1.73 1.74

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Nov 29 15:59:18 EST 2006


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

Modified Files:
	cmCMakeMinimumRequired.cxx cmCPluginAPI.cxx cmCacheManager.cxx 
	cmGlobalGenerator.cxx cmLocalGenerator.cxx 
	cmLocalUnixMakefileGenerator3.cxx cmMakefile.cxx cmMakefile.h 
	cmake.cxx cmake.h 
Log Message:
ENH: unify version stuff, get rid of it out of cmake and cmMakefile and only use cmVersion


Index: cmCacheManager.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCacheManager.cxx,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- cmCacheManager.cxx	14 Jun 2006 16:28:29 -0000	1.94
+++ cmCacheManager.cxx	29 Nov 2006 20:59:15 -0000	1.95
@@ -20,6 +20,7 @@
 #include "cmCacheManager.h"
 #include "cmMakefile.h"
 #include "cmake.h"
+#include "cmVersion.h"
 
 #include <cmsys/Directory.hxx>
 #include <cmsys/Glob.hxx>
@@ -370,17 +371,17 @@
   // before writing the cache, update the version numbers
   // to the
   char temp[1024];
-  sprintf(temp, "%d", cmMakefile::GetMinorVersion());
+  sprintf(temp, "%d", cmVersion::GetMinorVersion());
   this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp,
                       "Minor version of cmake used to create the "
                       "current loaded cache", cmCacheManager::INTERNAL);
-  sprintf(temp, "%d", cmMakefile::GetMajorVersion());
+  sprintf(temp, "%d", cmVersion::GetMajorVersion());
   this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp,
                       "Major version of cmake used to create the "
                       "current loaded cache", cmCacheManager::INTERNAL);
 
   this->AddCacheEntry("CMAKE_CACHE_RELEASE_VERSION",
-                      cmMakefile::GetReleaseVersion(),
+                      cmVersion::GetReleaseVersion().c_str(),
                       "Major 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.164
retrieving revision 1.165
diff -u -d -r1.164 -r1.165
--- cmLocalGenerator.cxx	25 Nov 2006 15:59:26 -0000	1.164
+++ cmLocalGenerator.cxx	29 Nov 2006 20:59:15 -0000	1.165
@@ -1643,7 +1643,6 @@
       {
       continue;
       }
-
     // Link to a library if it is not the same target and is meant for
     // this configuration type.
     if((target.GetType() == cmTarget::EXECUTABLE ||
@@ -1664,7 +1663,6 @@
         linkItem += "/";
         linkItem += tgt->GetFullName(config);
         linkLibraries.push_back(linkItem);
-
         // For full path, use the true location.
         if(fullPathLibs)
           {

Index: cmake.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- cmake.h	31 Oct 2006 19:28:48 -0000	1.73
+++ cmake.h	29 Nov 2006 20:59:16 -0000	1.74
@@ -60,13 +60,6 @@
   ///! destruct an instance of cmake
   ~cmake();
 
-  /**
-   * Return major and minor version numbers for cmake.
-   */
-  static unsigned int GetMajorVersion(); 
-  static unsigned int GetMinorVersion(); 
-  static const char *GetReleaseVersion();
-
   ///! construct an instance of cmake
   static const char *GetCMakeFilesDirectory() {return "/CMakeFiles";};
   static const char *GetCMakeFilesDirectoryPostSlash() {

Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -d -r1.163 -r1.164
--- cmGlobalGenerator.cxx	10 Nov 2006 14:32:27 -0000	1.163
+++ cmGlobalGenerator.cxx	29 Nov 2006 20:59:15 -0000	1.164
@@ -18,6 +18,7 @@
 #include "cmLocalGenerator.h"
 #include "cmake.h"
 #include "cmMakefile.h"
+#include "cmVersion.h"
 
 #include <stdlib.h> // required for atof
 
@@ -270,8 +271,8 @@
     // to avoid duplicate compiler tests.
     unsigned int cacheMajor = mf->GetCacheMajorVersion();
     unsigned int cacheMinor = mf->GetCacheMinorVersion();
-    unsigned int selfMajor = cmMakefile::GetMajorVersion();
-    unsigned int selfMinor = cmMakefile::GetMinorVersion();
+    unsigned int selfMajor = cmVersion::GetMajorVersion();
+    unsigned int selfMinor = cmVersion::GetMinorVersion();
     if((this->CMakeInstance->GetIsInTryCompile() ||
         (selfMajor == cacheMajor && selfMinor == cacheMinor))
        && !mf->GetDefinition(loadedLang.c_str()))

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.273
retrieving revision 1.274
diff -u -d -r1.273 -r1.274
--- cmake.cxx	31 Oct 2006 19:28:48 -0000	1.273
+++ cmake.cxx	29 Nov 2006 20:59:16 -0000	1.274
@@ -1487,8 +1487,8 @@
   if(!this->CacheManager->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))
     {
     char ver[256];
-    sprintf(ver,"%i.%i",cmMakefile::GetMajorVersion(),
-            cmMakefile::GetMinorVersion());
+    sprintf(ver,"%i.%i",cmVersion::GetMajorVersion(),
+            cmVersion::GetMinorVersion());
     this->CacheManager->AddCacheEntry
       ("CMAKE_BACKWARDS_COMPATIBILITY",ver, 
        "For backwards compatibility, what version of CMake commands and "
@@ -1680,10 +1680,10 @@
     this->CacheManager->GetCacheValue("CMAKE_CACHE_RELEASE_VERSION");
   bool cacheSameCMake = false;
   if(majv &&
-     atoi(majv) == static_cast<int>(cmMakefile::GetMajorVersion())
+     atoi(majv) == static_cast<int>(cmVersion::GetMajorVersion())
      && minv &&
-     atoi(minv) == static_cast<int>(cmMakefile::GetMinorVersion())
-     && relv && (strcmp(relv, cmMakefile::GetReleaseVersion()) == 0))
+     atoi(minv) == static_cast<int>(cmVersion::GetMinorVersion())
+     && relv && (strcmp(relv, cmVersion::GetReleaseVersion().c_str()) == 0))
     {
     cacheSameCMake = true;
     }
@@ -1815,21 +1815,6 @@
   return 0;
 }
 
-unsigned int cmake::GetMajorVersion()
-{
-  return cmMakefile::GetMajorVersion();
-}
-
-unsigned int cmake::GetMinorVersion()
-{
-  return cmMakefile::GetMinorVersion();
-}
-
-const char *cmake::GetReleaseVersion()
-{
-  return cmMakefile::GetReleaseVersion();
-}
-
 void cmake::AddCacheEntry(const char* key, const char* value,
                           const char* helpString,
                           int type)
@@ -1852,8 +1837,9 @@
   const char *terse;
   const char *full;
   char tmp[1024];
-  sprintf(tmp,"Version %d.%d (%s)", cmake::GetMajorVersion(),
-          cmake::GetMinorVersion(), cmVersion::GetReleaseVersion().c_str());
+  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";
   f << "<ul>\n";
@@ -1959,8 +1945,8 @@
   if(!this->CacheManager->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))
     {
     char ver[256];
-    sprintf(ver,"%i.%i",cmMakefile::GetMajorVersion(),
-            cmMakefile::GetMinorVersion());
+    sprintf(ver,"%i.%i",cmVersion::GetMajorVersion(),
+            cmVersion::GetMinorVersion());
     this->CacheManager->AddCacheEntry
       ("CMAKE_BACKWARDS_COMPATIBILITY",ver, 
        "For backwards compatibility, what version of CMake commands and "

Index: cmMakefile.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.h,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -d -r1.196 -r1.197
--- cmMakefile.h	5 Oct 2006 12:55:59 -0000	1.196
+++ cmMakefile.h	29 Nov 2006 20:59:16 -0000	1.197
@@ -50,14 +50,6 @@
 {
 public:
   /**
-   * 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 const char* GetReleaseVersion();
-  
-  /**
    * Return the major and minor version of the cmake that
    * was used to write the currently loaded cache, note
    * this method will not work before the cache is loaded.

Index: cmCPluginAPI.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCPluginAPI.cxx,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- cmCPluginAPI.cxx	28 Sep 2006 17:55:25 -0000	1.31
+++ cmCPluginAPI.cxx	29 Nov 2006 20:59:15 -0000	1.32
@@ -21,6 +21,7 @@
 
 #include "cmMakefile.h"
 #include "cmCPluginAPI.h"
+#include "cmVersion.h"
 
 #include "cmSourceFile.h"
 
@@ -65,12 +66,12 @@
 
 unsigned int CCONV cmGetMajorVersion(void *)
 {
-  return cmMakefile::GetMajorVersion();
+  return cmVersion::GetMajorVersion();
 }
 
 unsigned int CCONV cmGetMinorVersion(void *)
 {
-  return cmMakefile::GetMinorVersion();
+  return cmVersion::GetMinorVersion();
 }
 
 void CCONV cmAddDefinition(void *arg, const char* name, const char* value)

Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -d -r1.183 -r1.184
--- cmLocalUnixMakefileGenerator3.cxx	13 Oct 2006 14:22:45 -0000	1.183
+++ cmLocalUnixMakefileGenerator3.cxx	29 Nov 2006 20:59:15 -0000	1.184
@@ -23,6 +23,7 @@
 #include "cmMakefileTargetGenerator.h"
 #include "cmSourceFile.h"
 #include "cmake.h"
+#include "cmVersion.h"
 
 // Include dependency scanners for supported languages.  Only the
 // C/C++ scanner is needed for bootstrapping CMake.
@@ -1728,8 +1729,8 @@
     << "# CMAKE generated file: DO NOT EDIT!\n"
     << "# Generated by \"" << this->GlobalGenerator->GetName() << "\""
     << " Generator, CMake Version "
-    << cmMakefile::GetMajorVersion() << "."
-    << cmMakefile::GetMinorVersion() << "\n\n";
+    << cmVersion::GetMajorVersion() << "."
+    << cmVersion::GetMinorVersion() << "\n\n";
 }
 
 //----------------------------------------------------------------------------

Index: cmCMakeMinimumRequired.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCMakeMinimumRequired.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cmCMakeMinimumRequired.cxx	15 Mar 2006 16:01:59 -0000	1.11
+++ cmCMakeMinimumRequired.cxx	29 Nov 2006 20:59:15 -0000	1.12
@@ -72,9 +72,9 @@
 
 
   // Get the current version number.
-  int current_major = this->Makefile->GetMajorVersion();
-  int current_minor = this->Makefile->GetMinorVersion();
-  int current_patch = this->Makefile->GetPatchVersion();
+  int current_major = cmVersion::GetMajorVersion();
+  int current_minor = cmVersion::GetMinorVersion();
+  int current_patch = cmVersion::GetPatchVersion();
 
   // Parse the required version number.  If no patch-level is given
   // use zero.

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.366
retrieving revision 1.367
diff -u -d -r1.366 -r1.367
--- cmMakefile.cxx	29 Nov 2006 20:45:49 -0000	1.366
+++ cmMakefile.cxx	29 Nov 2006 20:59:16 -0000	1.367
@@ -15,7 +15,7 @@
 
 =========================================================================*/
 #include "cmMakefile.h"
-
+#include "cmVersion.h"
 #include "cmCommand.h"
 #include "cmSourceFile.h"
 #include "cmSystemTools.h"
@@ -133,23 +133,6 @@
   this->ListFileStack = mf.ListFileStack;
 }
 
-const char* cmMakefile::GetReleaseVersion()
-{
-#if CMake_VERSION_MINOR & 1
-  return "development";
-#else
-# if CMake_VERSION_PATCH == 1
-  return "1-beta";
-# 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  
-#endif
-}
 
 unsigned int cmMakefile::GetCacheMajorVersion()
 {
@@ -1965,11 +1948,11 @@
 #endif
 
   char temp[1024];
-  sprintf(temp, "%d", cmMakefile::GetMinorVersion());
+  sprintf(temp, "%d", cmVersion::GetMinorVersion());
   this->AddDefinition("CMAKE_MINOR_VERSION", temp);
-  sprintf(temp, "%d", cmMakefile::GetMajorVersion());
+  sprintf(temp, "%d", cmVersion::GetMajorVersion());
   this->AddDefinition("CMAKE_MAJOR_VERSION", temp);
-  sprintf(temp, "%d", cmMakefile::GetPatchVersion());
+  sprintf(temp, "%d", cmVersion::GetPatchVersion());
   this->AddDefinition("CMAKE_PATCH_VERSION", temp);
 
   this->AddDefinition("CMAKE_FILES_DIRECTORY", 



More information about the Cmake-commits mailing list