summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-12-21 20:45:55 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-12-21 20:45:55 (GMT)
commit391d3ed6310635b837e46ea6e22b737e57f1bea7 (patch)
treeada338f6c65449fdffe3e31cef0142f7c7da98b8 /Source/cmGlobalXCodeGenerator.cxx
parent5b95c0a881735cba6d6fcc661c6696d67f6badcd (diff)
downloadCMake-391d3ed6310635b837e46ea6e22b737e57f1bea7.zip
CMake-391d3ed6310635b837e46ea6e22b737e57f1bea7.tar.gz
CMake-391d3ed6310635b837e46ea6e22b737e57f1bea7.tar.bz2
ENH: make sure depend helper actually works, if a depend library gets updated, then the target needs to be removed, and the CONFIGURATION directory needs to be used
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx47
1 files changed, 40 insertions, 7 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 95b7c1d..8225a72 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -386,6 +386,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(cmLocalGenerator* root)
cmSystemTools::MakeDirectory(m_CurrentReRunCMakeMakefile.c_str());
m_CurrentReRunCMakeMakefile += "/ReRunCMake.make";
cmGeneratedFileStream makefileStream(m_CurrentReRunCMakeMakefile.c_str());
+ makefileStream.SetCopyIfDifferent(true);
makefileStream << "# Generated by CMake, DO NOT EDIT\n";
makefileStream << "CMakeFiles/cmake.check_cache: ";
for(std::vector<std::string>::const_iterator i = lfiles.begin();
@@ -845,6 +846,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
{
return;
}
+ makefileStream.SetCopyIfDifferent(true);
makefileStream << "# Generated by CMake, DO NOT EDIT\n";
makefileStream << "# Custom rules for " << target.GetName() << "\n";
@@ -1968,7 +1970,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
m_CurrentXCodeHackMakefile.c_str());
return;
}
-
+ makefileStream.SetCopyIfDifferent(true);
// one more pass for external depend information not handled
// correctly by xcode
makefileStream << "# DO NOT EDIT\n";
@@ -1986,8 +1988,8 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
t->GetType() == cmTarget::MODULE_LIBRARY)
{
makefileStream << "\\\n\t"
- << this->
- ConvertToRelativeForMake(this->GetTargetFullPath(target->GetcmTarget()).c_str());
+ << this->AddConfigDir(this->
+ ConvertToRelativeForMake(this->GetTargetFullPath(target->GetcmTarget()).c_str()).c_str());
}
}
makefileStream << "\n\n";
@@ -2005,7 +2007,9 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
{
if(emitted.insert(*d).second)
{
- makefileStream << this->ConvertToRelativeForMake(d->c_str()) << ":\n";
+ makefileStream <<
+ this->AddConfigDir(this->ConvertToRelativeForMake(d->c_str()).c_str())
+ << ":\n";
}
}
}
@@ -2026,21 +2030,50 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
{
std::vector<cmStdString> const& deplibs = target->GetDependLibraries();
std::string tfull = this->GetTargetFullPath(target->GetcmTarget());
- makefileStream << this->ConvertToRelativeForMake(tfull.c_str()) << ": ";
+ makefileStream << this->AddConfigDir(
+ this->ConvertToRelativeForMake(tfull.c_str()).c_str()) << ": ";
for(std::vector<cmStdString>::const_iterator d = deplibs.begin();
d != deplibs.end(); ++d)
{
- makefileStream << "\\\n\t" << this->ConvertToRelativeForMake(d->c_str());
+ makefileStream << "\\\n\t" <<
+ this->AddConfigDir(
+ this->ConvertToRelativeForMake(d->c_str()).c_str());
}
makefileStream << "\n";
makefileStream << "\t/bin/rm -f "
- << this->ConvertToRelativeForMake(tfull.c_str()) << "\n";
+ <<
+ this->AddConfigDir(
+ this->ConvertToRelativeForMake(tfull.c_str()).c_str())
+ << "\n";
makefileStream << "\n\n";
}
}
}
//----------------------------------------------------------------------------
+std::string
+cmGlobalXCodeGenerator::AddConfigDir(const char* d)
+{
+ if(m_XcodeVersion == 15)
+ {
+ return std::string(d);
+ }
+ std::string dir = d;
+ if(cmSystemTools::FileExists(d))
+ {
+ return dir;
+ }
+ std::string::size_type pos = dir.rfind("/");
+ if(pos == dir.npos)
+ {
+ return dir;
+ }
+ std::string ret = dir.substr(0, pos);
+ ret += "/${CONFIGURATION}";
+ ret += dir.substr(pos);
+ return ret;
+}
+//----------------------------------------------------------------------------
void
cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>&