[Cmake-commits] CMake branch, next, updated. v2.8.11.2-4037-gc360c69

Robert Maynard robert.maynard at kitware.com
Wed Aug 28 14:35:56 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  c360c6952b11a91d5dd553bb7ac5bcb8559fb12b (commit)
       via  0264eec9d32200c692ddfb756871ac4a4465863c (commit)
      from  ebac5ffd9cb72f6d6cc0a00899c5ea67021f95e8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c360c6952b11a91d5dd553bb7ac5bcb8559fb12b
commit c360c6952b11a91d5dd553bb7ac5bcb8559fb12b
Merge: ebac5ff 0264eec
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Wed Aug 28 14:35:53 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Aug 28 14:35:53 2013 -0400

    Merge topic 'no_track_configured_files' into next
    
    0264eec cmMakefile: Do not track configured files known to be temporary


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0264eec9d32200c692ddfb756871ac4a4465863c
commit 0264eec9d32200c692ddfb756871ac4a4465863c
Author:     Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Wed Aug 28 12:49:53 2013 -0400
Commit:     Robert Maynard <robert.maynard at kitware.com>
CommitDate: Wed Aug 28 12:49:53 2013 -0400

    cmMakefile: Do not track configured files known to be temporary
    
    Since commit ad502502 (cmMakefile: Track configured files so we can
    regenerate them, 2013-06-18) cmMakefile::ConfigureFile records the
    configured file as an output file generated by CMake.  The intention is
    that for make and ninja we can re-run CMake when one of the files it
    generates goes missing.  However, files configured temporarily in
    CMakeTmp directories by Check* modules do not live past the CMake
    invocation.
    
    Teach cmMakefile::FinalPass to stop tracking files that don't
    exist after we are finished generation.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1f5c911..2506209 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -814,6 +814,18 @@ bool cmMakefile::NeedBackwardsCompatibility(unsigned int major,
     }
 }
 
+
+namespace
+{
+  struct file_exists
+  {
+    bool operator()(const std::string& path) const
+    {
+      return cmSystemTools::FileExists(path.c_str());
+    }
+  };
+}
+
 void cmMakefile::FinalPass()
 {
   // do all the variable expansions here
@@ -827,6 +839,20 @@ void cmMakefile::FinalPass()
     (*i)->FinalPass();
     }
 
+  //go through all configured files and see which ones still exist.
+  //we don't want cmake to re-run if a configured file is created and deleted
+  //during processing as that would make it a transient file that can't
+  //influence the build process
+
+  //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() );
+  //we just have to erase all items at the back
+  this->OutputFiles.erase(new_end, this->OutputFiles.end() );
+
 }
 
 // Generate the output file
@@ -3371,11 +3397,12 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
   std::string sinfile = infile;
   this->AddCMakeDependFile(sinfile);
   cmSystemTools::ConvertToUnixSlashes(soutfile);
+
   // Re-generate if non-temporary outputs are missing.
-  if(soutfile.find("CMakeTmp") == soutfile.npos)
-    {
-    this->AddCMakeOutputFile(soutfile);
-    }
+  //when we finalize the configuration we will remove all
+  //output files that now don't exist.
+  this->AddCMakeOutputFile(soutfile);
+
   mode_t perm = 0;
   cmSystemTools::GetPermissions(sinfile.c_str(), perm);
   std::string::size_type pos = soutfile.rfind('/');

-----------------------------------------------------------------------

Summary of changes:
 Source/cmMakefile.cxx |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list