diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-09-08 18:35:37 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-09-08 18:35:37 (GMT) |
commit | 93ee345b41594b3050d0ee88b17c9e93a6bd822d (patch) | |
tree | c661374168d2865b9d157238095098f8d44ee1d7 /Source | |
parent | b72d77d929b247cf60059c6f1635d01ac31e70bc (diff) | |
download | CMake-93ee345b41594b3050d0ee88b17c9e93a6bd822d.zip CMake-93ee345b41594b3050d0ee88b17c9e93a6bd822d.tar.gz CMake-93ee345b41594b3050d0ee88b17c9e93a6bd822d.tar.bz2 |
BUG: fix xcode 15 (really bill Hoffman)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 61 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.h | 2 |
2 files changed, 41 insertions, 22 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 3efc1c5..51d396a 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1413,35 +1413,52 @@ void cmGlobalXCodeGenerator::AddDependTarget(cmXCodeObject* target, } } + +//---------------------------------------------------------------------------- +void cmGlobalXCodeGenerator::AppendOrAddBuildSetting(cmXCodeObject* settings, + const char* attribute, + const char* value) +{ + if(settings) + { + cmXCodeObject* attr = settings->GetObject(attribute); + if(!attr) + { + settings->AddAttribute(attribute, this->CreateString(value)); + } + else + { + std::string oldValue = attr->GetString(); + cmSystemTools::ReplaceString(oldValue, "\"", ""); + oldValue += " "; + oldValue += value; + attr->SetString(oldValue.c_str()); + } + } +} + //---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::AppendBuildSettingAttribute(cmXCodeObject* target, const char* attribute, const char* value) { - cmXCodeObject* configurationList = target->GetObject("buildConfigurationList")->GetObject(); - cmXCodeObject* buildConfigs = configurationList->GetObject("buildConfigurations"); - std::vector<cmXCodeObject*> list = buildConfigs->GetObjectList(); - // each configuration and the target itself has a buildSettings in it - list.push_back(target); - for(std::vector<cmXCodeObject*>::iterator i = list.begin(); i != list.end(); ++i) + if(m_XcodeVersion < 21) { + this->AppendOrAddBuildSetting(target->GetObject("buildSettings"), + attribute, value); + } + else + { + cmXCodeObject* configurationList = target->GetObject("buildConfigurationList")->GetObject(); + cmXCodeObject* buildConfigs = configurationList->GetObject("buildConfigurations"); + std::vector<cmXCodeObject*> list = buildConfigs->GetObjectList(); + // each configuration and the target itself has a buildSettings in it + list.push_back(target); + for(std::vector<cmXCodeObject*>::iterator i = list.begin(); i != list.end(); ++i) + { cmXCodeObject* settings = (*i)->GetObject("buildSettings"); - if(settings) - { - cmXCodeObject* attr = settings->GetObject(attribute); - if(!attr) - { - settings->AddAttribute(attribute, this->CreateString(value)); - } - else - { - std::string oldValue = attr->GetString(); - cmSystemTools::ReplaceString(oldValue, "\"", ""); - oldValue += " "; - oldValue += value; - attr->SetString(oldValue.c_str()); - } - } + this->AppendOrAddBuildSetting(settings, attribute, value); + } } } diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index faceff1..20e4088 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -100,6 +100,8 @@ private: cmXCodeObject* buildPhases); void AddConfigurations(cmXCodeObject* target, cmTarget& cmtarget); + void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr, + const char* value); void AppendBuildSettingAttribute(cmXCodeObject* target, const char* attr, const char* value); cmXCodeObject* CreateUtilityTarget(cmTarget& target); |