summaryrefslogtreecommitdiff
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-13 12:07:23 -0500
committerBrad King <brad.king@kitware.com>2011-01-13 12:07:23 -0500
commit809ef3086d27a79d25c53680e738ceb7bb9b18fc (patch)
tree38bdbd1dc5a7880ddf406d6a46b43211fe02992c /Source/cmGlobalXCodeGenerator.cxx
parent28a0403c3491d4a96f5dc827e54442a1d0a0dea7 (diff)
downloadcmake-809ef3086d27a79d25c53680e738ceb7bb9b18fc.tar.gz
Xcode: Make generation depend on all input directories
Previously the Xcode generator would rerun CMake only if input file dependencies in the top-level directory changed. Teach it to depend on input files from all directories. Other generators already do this. Reported-by: Johan Björk <phb@spotify.com>
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 59ca38f8bf..012dd9e263 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -355,7 +355,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
cmCustomCommandLines commandLines;
commandLines.push_back(makecommand);
// Add Re-Run CMake rules
- this->CreateReRunCMakeFile(root);
+ this->CreateReRunCMakeFile(root, gens);
// now make the allbuild depend on all the non-utility targets
// in the project
@@ -403,10 +403,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
}
//----------------------------------------------------------------------------
-void cmGlobalXCodeGenerator::CreateReRunCMakeFile(cmLocalGenerator* root)
+void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
+ cmLocalGenerator* root, std::vector<cmLocalGenerator*> const& gens)
{
cmMakefile* mf = root->GetMakefile();
- std::vector<std::string> lfiles = mf->GetListFiles();
+ std::vector<std::string> lfiles;
+ for(std::vector<cmLocalGenerator*>::const_iterator gi = gens.begin();
+ gi != gens.end(); ++gi)
+ {
+ std::vector<std::string> const& lf = (*gi)->GetMakefile()->GetListFiles();
+ lfiles.insert(lfiles.end(), lf.begin(), lf.end());
+ }
+
// sort the array
std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>());
std::vector<std::string>::iterator new_end =