Xcode: Re-factor code into GetObjectsNormalDirectory method

...in preparation for calling it from more than one location.
Required to support OBJECT_LIBRARY targets in Xcode.
This commit is contained in:
David Cole 2012-03-14 17:46:56 -04:00 committed by Brad King
parent 3a53005f7d
commit 34e4985eed
2 changed files with 27 additions and 9 deletions

View File

@ -3045,6 +3045,26 @@ void cmGlobalXCodeGenerator
this->RootObject->AddAttribute("targets", allTargets); this->RootObject->AddAttribute("targets", allTargets);
} }
//----------------------------------------------------------------------------
std::string
cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
const std::string &projName,
const std::string &configName,
const cmTarget *t) const
{
std::string dir =
t->GetMakefile()->GetCurrentOutputDirectory();
dir += "/";
dir += projName;
dir += ".build/";
dir += configName;
dir += "/";
dir += t->GetName();
dir += ".build/Objects-normal/";
return dir;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
@ -3169,15 +3189,8 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
// then remove those exectuables as well // then remove those exectuables as well
if(this->Architectures.size() > 1) if(this->Architectures.size() > 1)
{ {
std::string universal = std::string universal = this->GetObjectsNormalDirectory(
t->GetMakefile()->GetCurrentOutputDirectory(); this->CurrentProject, configName, t);
universal += "/";
universal += this->CurrentProject;
universal += ".build/";
universal += configName;
universal += "/";
universal += t->GetName();
universal += ".build/Objects-normal/";
for( std::vector<std::string>::iterator arch = for( std::vector<std::string>::iterator arch =
this->Architectures.begin(); this->Architectures.begin();
arch != this->Architectures.end(); ++arch) arch != this->Architectures.end(); ++arch)

View File

@ -200,6 +200,11 @@ protected:
std::vector<cmXCodeObject*> XCodeObjects; std::vector<cmXCodeObject*> XCodeObjects;
cmXCodeObject* RootObject; cmXCodeObject* RootObject;
private: private:
std::string GetObjectsNormalDirectory(
const std::string &projName,
const std::string &configName,
const cmTarget *t) const;
void addObject(cmXCodeObject *obj); void addObject(cmXCodeObject *obj);
std::string PostBuildMakeTarget(std::string const& tName, std::string PostBuildMakeTarget(std::string const& tName,
std::string const& configName); std::string const& configName);