MantisBT - CMake
View Issue Details
0013160CMakeCMakepublic2012-04-23 03:282013-01-09 10:55
Andreas Roth 
Brad King 
normalmajoralways
closedfixed 
WindowsWindows 76.1.7601
CMake 2.8.8 
CMake 2.8.9CMake 2.8.9 
0013160: try_compile leaves temporary directories
I installed the version 2.8.8 of CMake and i noticed that each try_compile run leaves a directory like build\CMakeFiles\CMakeTmp\cmTryCompileExec78340897.dir.

This behavior has been introduced to fix the issue described here:
http://public.kitware.com/Bug/view.php?id=12957 [^]

On a build machine i noticed that each CMake run gets slower and slower. After deleting all directories in build\CMakeFiles\CMakeTmp the speed got back to normal. I used the process monitor (from sysinternals) and saw that CMake enumerates all items in the build\CMakeFiles\CMakeTmp quite often. I don't know why, but i think that's the reason for the decreasing speed.
1. delete the CMakeCache.txt file if it exists
2. Run cmake -G "Visual Studio 9 2008" .
   with CMakeLists.txt:
   PROJECT(HelloWorld C CXX)
   this detects the compiler and leaves several directories in CMakeFiles\CMakeTmp.
3. goto step 1
No tags attached.
related to 0012957closed Brad King Compiler tests randomly fail on Win7 
has duplicate 0013407closed  Does not remove empty "cmTryCompileExec*.dir" directories 
Issue History
2012-04-23 03:28Andreas RothNew Issue
2012-04-23 10:18Brad KingNote Added: 0029311
2012-04-23 10:18Brad KingRelationship addedrelated to 0012957
2012-04-26 05:52Andreas RothNote Added: 0029346
2012-04-26 08:50Brad KingNote Added: 0029349
2012-04-26 08:50Brad KingStatusnew => resolved
2012-04-26 08:50Brad KingFixed in Version => CMake 2.8.9
2012-04-26 08:50Brad KingResolutionopen => fixed
2012-04-26 08:50Brad KingAssigned To => Brad King
2012-07-17 13:07Brad KingRelationship addedhas duplicate 0013407
2012-08-09 19:32David ColeTarget Version => CMake 2.8.9
2013-01-09 10:55Robert MaynardNote Added: 0032027
2013-01-09 10:55Robert MaynardStatusresolved => closed

Notes
(0029311)
Brad King   
2012-04-23 10:18   
Please try this patch (untested):
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 48f644b..ed485e3 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -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
           {
(0029346)
Andreas Roth   
2012-04-26 05:52   
I just tried yours patch and it works fine. Thx
(0029349)
Brad King   
2012-04-26 08:50   
Thanks for testing. Applied:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=953257ca [^]
(0032027)
Robert Maynard   
2013-01-09 10:55   
Closing resolved issues that have not been updated in more than 4 months.