mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 19:00:54 -06:00
Xcode: Compute version number earlier
This commit is contained in:
@@ -133,16 +133,12 @@ public:
|
||||
bool SupportsPlatform() const CM_OVERRIDE { return false; }
|
||||
};
|
||||
|
||||
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(cmake* cm,
|
||||
std::string const& version)
|
||||
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(
|
||||
cmake* cm, std::string const& version_string, unsigned int version_number)
|
||||
: cmGlobalGenerator(cm)
|
||||
{
|
||||
this->VersionString = version;
|
||||
|
||||
// Compute an integer form of the version number.
|
||||
unsigned int v[2] = { 0, 0 };
|
||||
sscanf(this->VersionString.c_str(), "%u.%u", &v[0], &v[1]);
|
||||
this->XcodeVersion = 10 * v[0] + v[1];
|
||||
this->VersionString = version_string;
|
||||
this->XcodeVersion = version_number;
|
||||
|
||||
this->RootObject = 0;
|
||||
this->MainGroupChildren = 0;
|
||||
@@ -189,8 +185,15 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
|
||||
parser.ParseFile(
|
||||
"/Developer/Applications/Xcode.app/Contents/version.plist");
|
||||
}
|
||||
std::string const& version_string = parser.Version;
|
||||
|
||||
// Compute an integer form of the version number.
|
||||
unsigned int v[2] = { 0, 0 };
|
||||
sscanf(version_string.c_str(), "%u.%u", &v[0], &v[1]);
|
||||
unsigned int version_number = 10 * v[0] + v[1];
|
||||
|
||||
CM_AUTO_PTR<cmGlobalXCodeGenerator> gg(
|
||||
new cmGlobalXCodeGenerator(cm, parser.Version));
|
||||
new cmGlobalXCodeGenerator(cm, version_string, version_number));
|
||||
if (gg->XcodeVersion == 20) {
|
||||
cmSystemTools::Message("Xcode 2.0 not really supported by cmake, "
|
||||
"using Xcode 15 generator\n");
|
||||
|
||||
@@ -32,7 +32,8 @@ struct cmDocumentationEntry;
|
||||
class cmGlobalXCodeGenerator : public cmGlobalGenerator
|
||||
{
|
||||
public:
|
||||
cmGlobalXCodeGenerator(cmake* cm, std::string const& version);
|
||||
cmGlobalXCodeGenerator(cmake* cm, std::string const& version_string,
|
||||
unsigned int version_number);
|
||||
static cmGlobalGeneratorFactory* NewFactory();
|
||||
|
||||
///! Get the name for the generator.
|
||||
|
||||
Reference in New Issue
Block a user