From 7e6f9fff2bb626160de15736084f36997a90d29c Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Fri, 13 Sep 2002 11:02:15 -0400 Subject: [PATCH] fix to the cleanup code --- Source/cmTryCompileCommand.cxx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index aed26e7b0..e7fe9d1fb 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -94,22 +94,24 @@ bool cmTryCompileCommand::InitialPass(std::vector const& argv) m_Makefile->AddDefinition(argv[0].c_str(), (res == 0 ? "TRUE" : "FALSE")); // if we created a directory etc, then cleanup after ourselves - /* - cmDirectory dir; - dir.Load(binaryDirectory); - size_t fileNum; - for (fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum) + if (argv.size() == 3) { - if (strcmp(dir.GetFile(fileNum),".") && - strcmp(dir.GetFile(fileNum),"..")) + cmDirectory dir; + dir.Load(binaryDirectory); + size_t fileNum; + for (fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum) { - std::string fullPath = binaryDirectory; - fullPath += "/"; - fullPath += dir.GetFile(fileNum); - cmSystemTools::RemoveFile(fullPath.c_str()); + if (strcmp(dir.GetFile(fileNum),".") && + strcmp(dir.GetFile(fileNum),"..")) + { + std::string fullPath = binaryDirectory; + fullPath += "/"; + fullPath += dir.GetFile(fileNum); + cmSystemTools::RemoveFile(fullPath.c_str()); + } } } - */ + return true; }