[Cmake-commits] CMake branch, next, updated. v3.1.0-1770-g05b2bb9

Brad King brad.king at kitware.com
Mon Jan 12 09:02:10 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  05b2bb94d9c908bb2c37bb9cfd74a6baa31c4b5d (commit)
       via  418bf735232b57a395e8965451620f77472f1087 (commit)
      from  2d0f1ec2b9b64b3100a80b1592ecc50b5d030395 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05b2bb94d9c908bb2c37bb9cfd74a6baa31c4b5d
commit 05b2bb94d9c908bb2c37bb9cfd74a6baa31c4b5d
Merge: 2d0f1ec 418bf73
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 12 09:02:09 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 12 09:02:09 2015 -0500

    Merge topic 'cpack-PackageMaker-OSX-10.10' into next
    
    418bf735 CPack: Fix PackageMaker internal versioning for OS X 10.10

diff --cc Source/CPack/cmCPackPackageMakerGenerator.cxx
index 8a22131,09f9e6b..f489389
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@@ -710,9 -725,9 +725,9 @@@ GenerateComponentPackage(const char *pa
                  packageFile << std::endl);
  
    // The command that will be used to run PackageMaker
 -  cmOStringStream pkgCmd;
 +  std::ostringstream pkgCmd;
  
-   if (this->PackageCompatibilityVersion < 10.5 ||
+   if (this->PackageCompatibilityVersion < getVersion(10, 5) ||
        this->PackageMakerVersion < 3.0)
      {
      // Create Description.plist and Info.plist files for normal Mac OS

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=418bf735232b57a395e8965451620f77472f1087
commit 418bf735232b57a395e8965451620f77472f1087
Author:     Calin Cascaval <cascaval at acm.org>
AuthorDate: Fri Dec 26 09:48:53 2014 -0800
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 12 08:34:51 2015 -0500

    CPack: Fix PackageMaker internal versioning for OS X 10.10
    
    Avoid using a floating point value to represent the version, since
    "10.10" would be treated as "10.1".

diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index d736948..09f9e6b 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -24,11 +24,20 @@
 #include <cmsys/Glob.hxx>
 #include <cmsys/FStream.hxx>
 
+#include <assert.h>
+
+static inline
+unsigned int getVersion(unsigned int major, unsigned int minor)
+{
+  assert(major < 256 && minor < 256);
+  return ((major & 0xFF) << 16 | minor);
+}
+
 //----------------------------------------------------------------------
 cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator()
 {
   this->PackageMakerVersion = 0.0;
-  this->PackageCompatibilityVersion = 10.4;
+  this->PackageCompatibilityVersion = getVersion(10, 4);
 }
 
 //----------------------------------------------------------------------
@@ -39,7 +48,7 @@ cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator()
 //----------------------------------------------------------------------
 bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const
 {
-  return this->PackageCompatibilityVersion >= 10.4;
+  return this->PackageCompatibilityVersion >= getVersion(10, 4);
 }
 
 //----------------------------------------------------------------------
@@ -241,7 +250,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
       std::string packageFile;
       if (compIt->second.IsDownloaded)
         {
-        if (this->PackageCompatibilityVersion >= 10.5 &&
+        if (this->PackageCompatibilityVersion >= getVersion(10, 5) &&
             this->PackageMakerVersion >= 3.0)
           {
           // Build this package within the upload directory.
@@ -260,7 +269,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
           }
         else if (!warnedAboutDownloadCompatibility)
           {
-          if (this->PackageCompatibilityVersion < 10.5)
+            if (this->PackageCompatibilityVersion < getVersion(10, 5))
             {
             cmCPackLogger(
               cmCPackLog::LOG_WARNING,
@@ -520,22 +529,28 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
   const char *packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION");
   if (packageCompat && *packageCompat)
     {
-    this->PackageCompatibilityVersion = atof(packageCompat);
+    unsigned int majorVersion = 10;
+    unsigned int minorVersion = 5;
+    int res = sscanf(packageCompat, "%u.%u", &majorVersion, &minorVersion);
+    if (res == 2)
+      {
+      this->PackageCompatibilityVersion = getVersion(majorVersion, minorVersion);
+      }
     }
   else if (this->GetOption("CPACK_DOWNLOAD_SITE"))
     {
     this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.5");
-    this->PackageCompatibilityVersion = 10.5;
+    this->PackageCompatibilityVersion = getVersion(10, 5);
     }
   else if (this->GetOption("CPACK_COMPONENTS_ALL"))
     {
     this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.4");
-    this->PackageCompatibilityVersion = 10.4;
+    this->PackageCompatibilityVersion = getVersion(10, 4);
     }
   else
     {
     this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.3");
-    this->PackageCompatibilityVersion = 10.3;
+    this->PackageCompatibilityVersion = getVersion(10, 3);
     }
 
   std::vector<std::string> no_paths;
@@ -712,7 +727,7 @@ GenerateComponentPackage(const char *packageFile,
   // The command that will be used to run PackageMaker
   cmOStringStream pkgCmd;
 
-  if (this->PackageCompatibilityVersion < 10.5 ||
+  if (this->PackageCompatibilityVersion < getVersion(10, 5) ||
       this->PackageMakerVersion < 3.0)
     {
     // Create Description.plist and Info.plist files for normal Mac OS
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h
index e350a60..4f9e2a8 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.h
+++ b/Source/CPack/cmCPackPackageMakerGenerator.h
@@ -117,7 +117,7 @@ protected:
   cmCPackComponent PostFlightComponent;
 
   double PackageMakerVersion;
-  double PackageCompatibilityVersion;
+  unsigned int PackageCompatibilityVersion;
 };
 
 #endif

-----------------------------------------------------------------------

Summary of changes:
 Source/CPack/cmCPackPackageMakerGenerator.cxx |   33 ++++++++++++++++++-------
 Source/CPack/cmCPackPackageMakerGenerator.h   |    2 +-
 2 files changed, 25 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list