summaryrefslogtreecommitdiffstats
path: root/Source/cmTryCompileCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-09-13 15:02:15 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-09-13 15:02:15 (GMT)
commit7e6f9fff2bb626160de15736084f36997a90d29c (patch)
treeb8a7d1bd70110a036b108d406465404c78bb8ae6 /Source/cmTryCompileCommand.cxx
parentb3b0eeba05d49a08cf6b0401b4ad6dc8906fa9e7 (diff)
downloadCMake-7e6f9fff2bb626160de15736084f36997a90d29c.zip
CMake-7e6f9fff2bb626160de15736084f36997a90d29c.tar.gz
CMake-7e6f9fff2bb626160de15736084f36997a90d29c.tar.bz2
fix to the cleanup code
Diffstat (limited to 'Source/cmTryCompileCommand.cxx')
-rw-r--r--Source/cmTryCompileCommand.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx
index aed26e7..e7fe9d1 100644
--- a/Source/cmTryCompileCommand.cxx
+++ b/Source/cmTryCompileCommand.cxx
@@ -94,22 +94,24 @@ bool cmTryCompileCommand::InitialPass(std::vector<std::string> 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;
}