summaryrefslogtreecommitdiff
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-11-10 08:15:13 -0500
committerBrad King <brad.king@kitware.com>2007-11-10 08:15:13 -0500
commit34c882a9f8b45350ba8d56d79a94e1602694ef8f (patch)
tree56068700357fbfc8ae093ad2c71a4647e65faf60 /Source/cmLocalVisualStudio7Generator.cxx
parent082fb6cc26aafda7eed9fc4827b3b1351b139747 (diff)
downloadcmake-34c882a9f8b45350ba8d56d79a94e1602694ef8f.tar.gz
ENH: Allow VS 7 project Rebuild and Solution Rebuild to work without re-running CMake for every project during the rebuild.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx31
1 files changed, 28 insertions, 3 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1e1321a1f3..63404a237b 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -164,17 +164,40 @@ void cmLocalVisualStudio7Generator
this->WriteVCProjFile(fout,lname,target);
}
+ // Create a helper file so CMake can determine when it is run
+ // through the rule created by AddVCProjBuildRule whether it really
+ // needs to regenerate the project. This file lists its own
+ // dependencies. If any file listed in it is newer than itself then
+ // CMake must rerun. Otherwise the project file is up to date and
+ // the stamp file can just be touched.
+ {
+ std::string depName = this->Makefile->GetStartOutputDirectory();
+ depName += cmake::GetCMakeFilesDirectory();
+ depName += "/";
+ depName += lname;
+ depName += ".vcproj.stamp.depend";
+ std::ofstream depFile(depName.c_str());
+ depFile << "# CMake dependency list for corresponding VS project.\n";
+ std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
+ for(std::vector<std::string>::const_iterator lf = listFiles.begin();
+ lf != listFiles.end(); ++lf)
+ {
+ depFile << *lf << std::endl;
+ }
+ }
+
// Touch a timestamp file used to determine when the project file is
// out of date.
- std::string stampName;
- stampName = this->Makefile->GetStartOutputDirectory();
+ {
+ std::string stampName = this->Makefile->GetStartOutputDirectory();
stampName += cmake::GetCMakeFilesDirectory();
cmSystemTools::MakeDirectory(stampName.c_str());
stampName += "/";
stampName += lname;
stampName += ".vcproj.stamp";
std::ofstream stamp(stampName.c_str());
- stamp << "# CMake timestamp for " << lname << ".vcproj" << std::endl;
+ stamp << "# CMake timestamp file for corresponding VS project.\n";
+ }
}
@@ -203,6 +226,8 @@ void cmLocalVisualStudio7Generator::AddVCProjBuildRule(cmTarget& tgt)
this->Convert(this->Makefile->GetHomeOutputDirectory(),
START_OUTPUT, UNCHANGED, true);
commandLine.push_back(args);
+ commandLine.push_back("--check-stamp-file");
+ commandLine.push_back(stampName.c_str());
std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();