I am not sure if you can prevent it from generating those files but you could remove those files with file(REMOVE ...) in your IF(insource) block.<br><br><div class="gmail_quote">On Fri, Nov 26, 2010 at 3:24 PM, Wylie, Brian <span dir="ltr">&lt;<a href="mailto:bnwylie@sandia.gov">bnwylie@sandia.gov</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi All,<br>
<br>
I want to force an &#39;out-of-source&#39; build for a small project that I converted to use Cmake.<br>
<br>
I did a bit of searching and found variants of the following...<br>
<br>
# Make sure the build is out of source<br>
STRING(COMPARE EQUAL &quot;${CMAKE_SOURCE_DIR}&quot; &quot;${CMAKE_BINARY_DIR}&quot; insource)<br>
  IF(insource)<br>
    MESSAGE(FATAL_ERROR &quot;Do not build in your source dir please :)&quot;)<br>
  ENDIF(insource)<br>
<br>
<br>
It works but it still generates a CMakeCache.txt file and a CMakeFiles directory in the source directory (which I&#39;ve also seen others discussing)...  is there a more official way to block &#39;in-source&#39; builds that leaves the source dir pristine?<br>


<br>
  Brian Wylie - Org 1424<br>
  Sandia National Laboratories<br>
  MS 1323 - Building CSRI/242<br>
  (505)844-2238 FAX(505)284-2518<br>
       _______ __<br>
      /_  __(_) /_____ _____<br>
       / / / / __/ __ `/ __ \<br>
      / / / / /_/ /_/ / / / /<br>
     /_/ /_/\__/\__,_/_/ /_/<br>
 Scalable Analysis and Visualization<br>
<br>
<br>
<br>
_______________________________________________<br>
Titan-developers mailing list<br>
<a href="mailto:Titan-developers@public.kitware.com">Titan-developers@public.kitware.com</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/titan-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/titan-developers</a><br>
</blockquote></div><br>