summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-05-11 17:52:33 (GMT)
committerBrad King <brad.king@kitware.com>2007-05-11 17:52:33 (GMT)
commit6c421971b9a0e8172cd1e7d493dee506bfd409b7 (patch)
treea3bb81aa21fca700ebf02d7abda61dbcf27e05ef /Source/cmGlobalXCodeGenerator.cxx
parent1c318150a6ea096cea2b3f36004709b60eac8213 (diff)
downloadCMake-6c421971b9a0e8172cd1e7d493dee506bfd409b7.zip
CMake-6c421971b9a0e8172cd1e7d493dee506bfd409b7.tar.gz
CMake-6c421971b9a0e8172cd1e7d493dee506bfd409b7.tar.bz2
BUG: Fixed generation of XCODE_DEPEND_HELPER.make into proper directory. Cleaned up duplicate code created by recent changes.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx39
1 files changed, 19 insertions, 20 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ed18664..104ba19 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -229,14 +229,7 @@ void cmGlobalXCodeGenerator::Generate()
for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
{
cmLocalGenerator* root = it->second[0];
- this->CurrentProject = root->GetMakefile()->GetProjectName();
- this->SetCurrentLocalGenerator(root);
- this->OutputDir = this->CurrentMakefile->GetHomeOutputDirectory();
- this->OutputDir =
- cmSystemTools::CollapseFullPath(this->OutputDir.c_str());
- cmSystemTools::SplitPath(this->OutputDir.c_str(),
- this->ProjectOutputDirectoryComponents);
- this->CurrentLocalGenerator = root;
+ this->SetGenerationRoot(root);
// add ALL_BUILD, INSTALL, etc
this->AddExtraTargets(root, it->second);
}
@@ -244,20 +237,30 @@ void cmGlobalXCodeGenerator::Generate()
for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
{
cmLocalGenerator* root = it->second[0];
- this->CurrentProject = root->GetMakefile()->GetProjectName();
- this->SetCurrentLocalGenerator(root);
- this->OutputDir = this->CurrentMakefile->GetHomeOutputDirectory();
- this->OutputDir =
- cmSystemTools::CollapseFullPath(this->OutputDir.c_str());
- cmSystemTools::SplitPath(this->OutputDir.c_str(),
- this->ProjectOutputDirectoryComponents);
- this->CurrentLocalGenerator = root;
+ this->SetGenerationRoot(root);
// now create the project
this->OutputXCodeProject(root, it->second);
}
}
//----------------------------------------------------------------------------
+void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
+{
+ this->CurrentProject = root->GetMakefile()->GetProjectName();
+ this->SetCurrentLocalGenerator(root);
+ std::string outDir = this->CurrentMakefile->GetHomeOutputDirectory();
+ outDir =cmSystemTools::CollapseFullPath(outDir.c_str());
+ cmSystemTools::SplitPath(outDir.c_str(),
+ this->ProjectOutputDirectoryComponents);
+
+ this->CurrentXCodeHackMakefile =
+ root->GetMakefile()->GetCurrentOutputDirectory();
+ this->CurrentXCodeHackMakefile += "/CMakeScripts";
+ cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile.c_str());
+ this->CurrentXCodeHackMakefile += "/XCODE_DEPEND_HELPER.make";
+}
+
+//----------------------------------------------------------------------------
void
cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& gens)
@@ -273,10 +276,6 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
// Add XCODE depend helper
std::string dir = mf->GetCurrentOutputDirectory();
- this->CurrentXCodeHackMakefile = dir;
- this->CurrentXCodeHackMakefile += "/CMakeScripts";
- cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile.c_str());
- this->CurrentXCodeHackMakefile += "/XCODE_DEPEND_HELPER.make";
cmCustomCommandLine makecommand;
makecommand.push_back("make");
makecommand.push_back("-C");