diff options
author | Brad King <brad.king@kitware.com> | 2007-05-11 17:52:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-05-11 17:52:33 (GMT) |
commit | 6c421971b9a0e8172cd1e7d493dee506bfd409b7 (patch) | |
tree | a3bb81aa21fca700ebf02d7abda61dbcf27e05ef /Source | |
parent | 1c318150a6ea096cea2b3f36004709b60eac8213 (diff) | |
download | CMake-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')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 39 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.h | 2 |
2 files changed, 20 insertions, 21 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"); diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index b484ea3..5c8caa5 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -157,6 +157,7 @@ private: cmXCodeObject* dependTarget); void CreateXCodeDependHackTarget(std::vector<cmXCodeObject*>& targets); bool SpecialTargetEmitted(std::string const& tname); + void SetGenerationRoot(cmLocalGenerator* root); void AddExtraTargets(cmLocalGenerator* root, std::vector<cmLocalGenerator*>& gens); cmXCodeObject* CreateBuildPhase(const char* name, @@ -186,7 +187,6 @@ private: std::string CurrentReRunCMakeMakefile; std::string CurrentXCodeHackMakefile; std::string CurrentProject; - std::string OutputDir; std::set<cmStdString> TargetDoneSet; std::vector<std::string> CurrentOutputDirectoryComponents; std::vector<std::string> ProjectOutputDirectoryComponents; |