diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-03-09 19:30:35 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-03-09 19:30:35 (GMT) |
commit | 4c5ba06fa13a2bc07f7e0a26bf455dc0b09d5e9c (patch) | |
tree | 36dd3cbb29d7773e102a0c58dee4ef3a5063c7c9 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | d253baab99663f531d91d406faf6fe2b822f5cb8 (diff) | |
download | CMake-4c5ba06fa13a2bc07f7e0a26bf455dc0b09d5e9c.zip CMake-4c5ba06fa13a2bc07f7e0a26bf455dc0b09d5e9c.tar.gz CMake-4c5ba06fa13a2bc07f7e0a26bf455dc0b09d5e9c.tar.bz2 |
ENH: use a cmake script to do the clean step, this allows for large numbers of files to be removed without making the command line too long
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 5045d52..94e14da 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -813,17 +813,37 @@ cmLocalUnixMakefileGenerator3 void cmLocalUnixMakefileGenerator3 ::AppendCleanCommand(std::vector<std::string>& commands, - const std::vector<std::string>& files) + const std::vector<std::string>& files, + cmTarget& target, const char* filename) { if(!files.empty()) { - std::string remove = "$(CMAKE_COMMAND) -E remove -f"; + std::string cleanfile = m_Makefile->GetCurrentOutputDirectory(); + cleanfile += "/"; + cleanfile += this->GetTargetDirectory(target); + cleanfile += "/cmake_clean"; + if(filename) + { + cleanfile += "_"; + cleanfile += filename; + } + cleanfile += ".cmake"; + std::string cleanfilePath = this->Convert(cleanfile.c_str(), FULL); + std::ofstream fout(cleanfilePath.c_str()); + if(!fout) + { + cmSystemTools::Error("Could not create ", cleanfilePath.c_str()); + } + fout << "FILE(REMOVE\n"; + std::string remove = "$(CMAKE_COMMAND) -P "; + remove += this->Convert(cleanfile.c_str(), START_OUTPUT, SHELL); for(std::vector<std::string>::const_iterator f = files.begin(); f != files.end(); ++f) { - remove += " "; - remove += this->Convert(f->c_str(),START_OUTPUT,SHELL); + fout << "\"" << this->Convert(f->c_str(),START_OUTPUT,UNCHANGED) + << "\"\n"; } + fout << ")\n"; commands.push_back(remove); } } |