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.
This commit is contained in:
Brad King 2013-07-30 14:39:31 -04:00
parent ad502502df
commit 8fbf39a471
1 changed files with 5 additions and 1 deletions

View File

@ -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('/');