$OpenBSD: patch-Source_cmCoreTryCompile_cxx,v 1.1 2012/05/07 13:58:18 dcoppa Exp $

try_compile: Cleanup temporary directories

Since commit 4fbdce2b (try_compile: Use random executable file name,
2012-02-13) a different <target>.dir is used for each try-compile.
Cleanup the directories as well as their content to avoid accumulating
leftover temporary directories.
(upstream git commit 953257ca611526c9a161a22e5148802be1c67649)

--- Source/cmCoreTryCompile.cxx.orig	Mon May  7 13:34:33 2012
+++ Source/cmCoreTryCompile.cxx	Mon May  7 13:35:05 2012
@@ -404,6 +404,7 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir
         if(cmSystemTools::FileIsDirectory(fullPath.c_str()))
           {
           this->CleanupFiles(fullPath.c_str());
+          cmSystemTools::RemoveADirectory(fullPath.c_str());
           }
         else
           {
