summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-04-10 13:53:00 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2006-04-10 13:53:00 -0400
commit8c06f8e2943c1d3726428ea01ba6bc5b49101081 (patch)
treeab6b7ed577382b8a61d8f63e95e3a67807f32cd3
parent3df8a59374aac7810520e59c48818d86708f27ac (diff)
downloadcmake-8c06f8e2943c1d3726428ea01ba6bc5b49101081.tar.gz
ENH: add support for re-running cmake if the cmakefiles change
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx7
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Source/cmMakefile.h10
3 files changed, 17 insertions, 1 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 0baa4945d7..048ff5090f 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -287,6 +287,13 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
tmpStr += "/CMakeFiles/CMakeDirectoryInformation.cmake";
cmakefileStream << " \"" <<
lg->Convert(tmpStr.c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() << "\"\n";
+ const std::vector<std::string>& outfiles = lg->GetMakefile()->GetOutputFiles();
+ for(std::vector<std::string>::const_iterator k= outfiles.begin();
+ k != outfiles.end(); ++k)
+ {
+ cmakefileStream << " \"" <<
+ lg->Convert(k->c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() << "\"\n";
+ }
}
cmakefileStream << " )\n\n";
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4c2368339a..7e434cf5b3 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2368,6 +2368,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
std::string soutfile = outfile;
std::string sinfile = infile;
this->AddCMakeDependFile(infile);
+ this->AddCMakeOutputFile(outfile);
cmSystemTools::ConvertToUnixSlashes(soutfile);
mode_t perm = 0;
cmSystemTools::GetPermissions(sinfile.c_str(), perm);
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index a3f7ec96a7..1b80959548 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -524,12 +524,19 @@ public:
*/
const std::vector<std::string>& GetListFiles() const
{ return this->ListFiles; }
-
///! When the file changes cmake will be re-run from the build system.
void AddCMakeDependFile(const char* file)
{ this->ListFiles.push_back(file);}
/**
+ * Get the vector of files created by this makefile
+ */
+ const std::vector<std::string>& GetOutputFiles() const
+ { return this->OutputFiles; }
+ void AddCMakeOutputFile(const char* file)
+ { this->ListFiles.push_back(file);}
+
+ /**
* Expand all defined variables in the string.
* Defined variables come from the this->Definitions map.
* They are expanded with ${var} where var is the
@@ -709,6 +716,7 @@ protected:
std::vector<std::string> LinkDirectories;
std::vector<std::string> ListFiles; // list of command files loaded
+ std::vector<std::string> OutputFiles; // list of command files loaded
cmTarget::LinkLibraryVectorType LinkLibraries;