summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-30 18:39:31 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-30 18:43:59 (GMT)
commit8fbf39a471593e3607e67a8915a1ec0e150d3298 (patch)
tree0a5a4a1c37daa450212a16138e897d9c23c4b07b
parentad502502dfee281e5b0ad8ac57057d72220b4380 (diff)
downloadCMake-8fbf39a471593e3607e67a8915a1ec0e150d3298.zip
CMake-8fbf39a471593e3607e67a8915a1ec0e150d3298.tar.gz
CMake-8fbf39a471593e3607e67a8915a1ec0e150d3298.tar.bz2
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::ConfigureFile to skip tracking files with "CMakeTmp" in their path, just like cmCoreTryCompile::TryCompileCode does to avoid adding dependencies on temporary source files. In the future we will need a more general filter to avoid recording as CMake outputs any files that do not exist at the end of generation.
-rw-r--r--Source/cmMakefile.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f3a66ba..1f5c911 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3371,7 +3371,11 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
std::string sinfile = infile;
this->AddCMakeDependFile(sinfile);
cmSystemTools::ConvertToUnixSlashes(soutfile);
- this->AddCMakeOutputFile(soutfile);
+ // Re-generate if non-temporary outputs are missing.
+ if(soutfile.find("CMakeTmp") == soutfile.npos)
+ {
+ this->AddCMakeOutputFile(soutfile);
+ }
mode_t perm = 0;
cmSystemTools::GetPermissions(sinfile.c_str(), perm);
std::string::size_type pos = soutfile.rfind('/');