summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-09-09 15:01:56 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-09-09 15:01:56 (GMT)
commit1e11708a560f0d06867fb3f2a83149b224ef44ba (patch)
tree17f181bfbdc935b924a04cd099508648b51e3113 /Source/cmMakefile.cxx
parent92cc6539799b3236b184eea0506f8d22bf5c9035 (diff)
parent38571f2c9446343a652cfdccea636028abd9f7aa (diff)
downloadCMake-1e11708a560f0d06867fb3f2a83149b224ef44ba.zip
CMake-1e11708a560f0d06867fb3f2a83149b224ef44ba.tar.gz
CMake-1e11708a560f0d06867fb3f2a83149b224ef44ba.tar.bz2
Merge topic 'no_track_configured_files'
38571f2 cmMakefile: Do not track CMake temporary files.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx28
1 files changed, 19 insertions, 9 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4baf345..fd06a33 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -819,12 +819,13 @@ bool cmMakefile::NeedBackwardsCompatibility(unsigned int major,
namespace
{
- struct file_exists
+ struct file_not_persistent
{
bool operator()(const std::string& path) const
- {
- return cmSystemTools::FileExists(path.c_str());
- }
+ {
+ return !(path.find("CMakeTmp") == path.npos &&
+ cmSystemTools::FileExists(path.c_str()));
+ }
};
}
@@ -848,13 +849,22 @@ void cmMakefile::FinalPass()
//remove_if will move all items that don't have a valid file name to the
//back of the vector
- std::vector<std::string>::iterator new_end = std::remove_if(
- this->OutputFiles.begin(),
- this->OutputFiles.end(),
- file_exists() );
+ std::vector<std::string>::iterator new_output_files_end = std::remove_if(
+ this->OutputFiles.begin(),
+ this->OutputFiles.end(),
+ file_not_persistent() );
//we just have to erase all items at the back
- this->OutputFiles.erase(new_end, this->OutputFiles.end() );
+ this->OutputFiles.erase(new_output_files_end, this->OutputFiles.end() );
+
+ //if a configured file is used as input for another configured file,
+ //and then deleted it will show up in the input list files so we
+ //need to scan those too
+ std::vector<std::string>::iterator new_list_files_end = std::remove_if(
+ this->ListFiles.begin(),
+ this->ListFiles.end(),
+ file_not_persistent() );
+ this->ListFiles.erase(new_list_files_end, this->ListFiles.end() );
}
// Generate the output file