ENH: use ccommand for del on windows

This commit is contained in:
Bill Hoffman 2002-03-26 12:38:52 -05:00
parent 60d604ae4e
commit 7fc14a9cb4
3 changed files with 14 additions and 7 deletions

View File

@ -51,7 +51,14 @@ int main(int ac, char** av)
{ {
for ( std::string::size_type cc = 2; cc < args.size(); cc ++ ) for ( std::string::size_type cc = 2; cc < args.size(); cc ++ )
{ {
cmSystemTools::RemoveFile(args[cc].c_str()); if(args[cc] != "-f")
{
if(args[cc] == "\\-f")
{
args[cc] = "-f";
}
cmSystemTools::RemoveFile(args[cc].c_str());
}
} }
return 0; return 0;
} }

View File

@ -81,8 +81,7 @@ void cmBorlandMakefileGenerator::OutputMakeVariables(std::ostream& fout)
"NULL=\n" "NULL=\n"
"!ELSE \n" "!ELSE \n"
"NULL=nul\n" "NULL=nul\n"
"!ENDIF \n" "!ENDIF \n";
"RM = del\n";
std::string buildType = "CMAKE_CXX_FLAGS_"; std::string buildType = "CMAKE_CXX_FLAGS_";
buildType += m_Makefile->GetDefinition("CMAKE_BUILD_TYPE"); buildType += m_Makefile->GetDefinition("CMAKE_BUILD_TYPE");
buildType = cmSystemTools::UpperCase(buildType); buildType = cmSystemTools::UpperCase(buildType);
@ -99,7 +98,8 @@ void cmBorlandMakefileGenerator::OutputMakeVariables(std::ostream& fout)
std::string replaceVars = variables; std::string replaceVars = variables;
m_Makefile->ExpandVariablesInString(replaceVars); m_Makefile->ExpandVariablesInString(replaceVars);
std::string ccommand = m_Makefile->GetDefinition("CCOMMAND_COMMAND");
fout << "RM = " << this->ConvertToOutputPath(ccommand.c_str()) << " remove -f\n";
std::string ccompiler = m_Makefile->GetDefinition("CMAKE_C_COMPILER"); std::string ccompiler = m_Makefile->GetDefinition("CMAKE_C_COMPILER");
fout << "CMAKE_C_COMPILER = " fout << "CMAKE_C_COMPILER = "
<< this->ConvertToOutputPath(ccompiler.c_str()) << this->ConvertToOutputPath(ccompiler.c_str())

View File

@ -137,8 +137,7 @@ void cmNMakeMakefileGenerator::OutputMakeVariables(std::ostream& fout)
"NULL=\n" "NULL=\n"
"!ELSE \n" "!ELSE \n"
"NULL=nul\n" "NULL=nul\n"
"!ENDIF \n" "!ENDIF \n";
"RM = del\n";
std::string buildType = "CMAKE_CXX_FLAGS_"; std::string buildType = "CMAKE_CXX_FLAGS_";
buildType += m_Makefile->GetDefinition("CMAKE_BUILD_TYPE"); buildType += m_Makefile->GetDefinition("CMAKE_BUILD_TYPE");
@ -157,7 +156,8 @@ void cmNMakeMakefileGenerator::OutputMakeVariables(std::ostream& fout)
std::string replaceVars = variables; std::string replaceVars = variables;
m_Makefile->ExpandVariablesInString(replaceVars); m_Makefile->ExpandVariablesInString(replaceVars);
fout << replaceVars.c_str(); fout << replaceVars.c_str();
std::string ccommand = m_Makefile->GetDefinition("CCOMMAND_COMMAND");
fout << "RM = " << this->ConvertToOutputPath(ccommand.c_str()) << " remove -f\n";
std::string ccompiler = m_Makefile->GetDefinition("CMAKE_C_COMPILER"); std::string ccompiler = m_Makefile->GetDefinition("CMAKE_C_COMPILER");
fout << "CMAKE_C_COMPILER = " fout << "CMAKE_C_COMPILER = "
<< this->ConvertToOutputPath(ccompiler.c_str()) << "\n"; << this->ConvertToOutputPath(ccompiler.c_str()) << "\n";