From 8c06f8e2943c1d3726428ea01ba6bc5b49101081 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 10 Apr 2006 13:53:00 -0400 Subject: ENH: add support for re-running cmake if the cmakefiles change --- Source/cmGlobalUnixMakefileGenerator3.cxx | 7 +++++++ Source/cmMakefile.cxx | 1 + Source/cmMakefile.h | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) 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& outfiles = lg->GetMakefile()->GetOutputFiles(); + for(std::vector::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,11 +524,18 @@ public: */ const std::vector& 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& 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. @@ -709,6 +716,7 @@ protected: std::vector LinkDirectories; std::vector ListFiles; // list of command files loaded + std::vector OutputFiles; // list of command files loaded cmTarget::LinkLibraryVectorType LinkLibraries; -- cgit v1.2.1