title: Why is MSBuild generating .tlog files into CMakeFiles/CompilerIdC, and how do I make it stop?
body: <p>I have a CMake project, and one of my builds is on Visual Studio, using MSBuild, on a TeamCity buildserver.</p>
  
  <p>What I'm seeing is frequent failures when running <code>git clean -f -d -x</code> (a step TeamCity does by itself while initializing a build, as part of source checkout). The reason it fails is because <code>.tlog</code> files are being generated into my CMake build folder -- into CMake's internal <code>CompilerIdC</code> project, which CMake uses to identify the local C compiler.</p>
  
  <p><strong>What are <code>.tlog</code> files for, and what triggers their creation?</strong> I haven't found documentation for this.</p>
  
  <p>I don't understand why they're appearing <em>after</em> CMake's run, and build, are already finished. I especially don't understand why they're being created more than fifteen minutes after all of <code>CompilerIdC</code>'s source and project files have been deleted.</p>
  
  <h2>Details</h2>
  
  <p>The files are being generated into <code>${CMAKE_BUILD_DIR}/CMakeFiles/3.5.2/CompilerIdC/Debug/CompilerIdC.tlog</code> . They're all of the form <code>link-VCTIP.(read|write|delete).*.tlog</code>.</p>
  
  <p>Here's the state of the folder for a build that failed on <code>git clean</code> and stopped at 08:41 (current as of 09:30):</p>
  
  <pre><code>-rw-r--r-- 1 CI 197121  570 Jun 28 08:57 link-VCTIP.delete.1.tlog
  -rw-r--r-- 1 CI 197121 1422 Jun 28 08:57 link-VCTIP.delete.26.tlog
  -rw-r--r-- 1 CI 197121 7062 Jun 28 08:57 link-VCTIP.read.1.tlog
  -rw-r--r-- 1 CI 197121  402 Jun 28 08:50 link-VCTIP.read.103.tlog
  -rw-r--r-- 1 CI 197121  402 Jun 28 08:55 link-VCTIP.read.120.tlog
  -rw-r--r-- 1 CI 197121  418 Jun 28 08:57 link-VCTIP.read.26.tlog
  -rw-r--r-- 1 CI 197121  286 Jun 28 08:57 link-VCTIP.read.27.tlog
  -rw-r--r-- 1 CI 197121  286 Jun 28 08:57 link-VCTIP.read.28.tlog
  -rw-r--r-- 1 CI 197121  286 Jun 28 08:57 link-VCTIP.read.29.tlog
  -rw-r--r-- 1 CI 197121  402 Jun 28 08:45 link-VCTIP.read.87.tlog
  -rw-r--r-- 1 CI 197121  600 Jun 28 08:57 link-VCTIP.write.1.tlog
  -rw-r--r-- 1 CI 197121  286 Jun 28 08:57 link-VCTIP.write.26.tlog
  </code></pre>
  
  <p>The build log looks like this:</p>
  
  <pre><code>[08:39:58][VCS Root: MyVCS] [D:\TeamCity\buildAgent\work\58a2d5637a76fb3e]: "C:\Program Files\Git\bin\git.exe" clean -f -d -x
  [08:41:26][VCS Root: MyVCS] warning: failed to remove build/Windows-x64-Release/: Directory not empty
  [08:41:27]
  [Updating sources] Failed to perform checkout on agent: '"C:\Program Files\Git\bin\git.exe" clean -f -d -x' command failed.
  stdout: Removing Artifacts/x64/
  &lt;snip&gt;
  Removing build/Windows-x64-Release/CMakeFiles
  &lt;snip&gt;
  stderr: warning: failed to remove build/Windows-x64-Release/: Directory not empty
  </code></pre>
  
  <h2>Version Info</h2>
  
  <p>The tools I'm using are:</p>
  
  <ul>
  <li>MSBuild 14.0</li>
  <li>CMake 3.5.2</li>
  <li>TeamCity Professional 9.1.7</li>
  </ul>