[Cmake-commits] CMake branch, next, updated. v3.1.0-1774-g7e8c54f
Brad King
brad.king at kitware.com
Mon Jan 12 09:13:01 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 7e8c54f2d4d98b82f16dd15d02026691e8ae052f (commit)
via 70abf6e780185c9c7041593bc99aff0a26bc9265 (commit)
from be4c0c959ea29d10e321b4801dcb9555e1da3231 (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=7e8c54f2d4d98b82f16dd15d02026691e8ae052f
commit 7e8c54f2d4d98b82f16dd15d02026691e8ae052f
Merge: be4c0c9 70abf6e
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 12 09:13:01 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 12 09:13:01 2015 -0500
Merge topic 'cpack-PackageMaker-OSX-10.10' into next
70abf6e7 CPack: Fix PackageMaker internal versioning for OS X 10.10
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70abf6e780185c9c7041593bc99aff0a26bc9265
commit 70abf6e780185c9c7041593bc99aff0a26bc9265
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 09:12:50 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..e58415c 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,29 @@ 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 +728,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:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list