diff options
author | Brad King <brad.king@kitware.com> | 2017-04-21 17:08:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-21 17:10:28 (GMT) |
commit | eaf53849ec760ecc1000ab6f56519f203c9b4ff5 (patch) | |
tree | 7e89c4d33b7afb8c84a23d36596ec44ed8056d4b /Source/cmGlobalXCodeGenerator.cxx | |
parent | 294cf948dc37799e1980685afbf1fa585ad5b0fb (diff) | |
download | CMake-eaf53849ec760ecc1000ab6f56519f203c9b4ff5.zip CMake-eaf53849ec760ecc1000ab6f56519f203c9b4ff5.tar.gz CMake-eaf53849ec760ecc1000ab6f56519f203c9b4ff5.tar.bz2 |
Xcode: Compute version number earlier
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 4213751..8968bb2 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -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"); |