From 809ef3086d27a79d25c53680e738ceb7bb9b18fc Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 13 Jan 2011 12:07:23 -0500 Subject: Xcode: Make generation depend on all input directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Source/cmGlobalXCodeGenerator.cxx | 14 +++++++++++--- Source/cmGlobalXCodeGenerator.h | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 59ca38f..012dd9e 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 const& gens) { cmMakefile* mf = root->GetMakefile(); - std::vector lfiles = mf->GetListFiles(); + std::vector lfiles; + for(std::vector::const_iterator gi = gens.begin(); + gi != gens.end(); ++gi) + { + std::vector 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::vector::iterator new_end = diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index b4de805..290532a 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -171,7 +171,8 @@ private: const char* name2, cmTarget& cmtarget, const std::vector&); - void CreateReRunCMakeFile(cmLocalGenerator* root); + void CreateReRunCMakeFile(cmLocalGenerator* root, + std::vector const& gens); std::string LookupFlags(const char* varNamePrefix, const char* varNameLang, -- cgit v0.12