I use a technique like this:<div><br></div><div>  configure_file(input ${CMAKE_CURRENT_BINARY_DIR}/proj-CMakeLists.txt @ONLY)<br>    # or maybe COPYONLY instead of @ONLY if you have no replacements occurring</div><div><br>
  ExternalProject_Add(proj</div><div>    URL <a href="http://blah/blah/blah.tar.gz">http://blah/blah/blah.tar.gz</a></div><div>    URL_MD5 md5-ofcourse</div><div>    PATCH_COMMAND ${CMAKE_COMMAND} -E copy</div><div>      ${CMAKE_CURRENT_BINARY_DIR}/proj-CMakeLists.txt</div>
<div>      &lt;SOURCE_DIR&gt;/CMakeLists.txt</div><div>    ...</div><div>  )</div><div><br></div><div>That should work if your &quot;proj&quot; source comes from a .tar.gz file without a CMakeLists file in it, or with a CMakeLists.txt file that you want to overwrite with your own.</div>
<div><br></div><div>Let me know if you run into problems with it.</div><div><br><div class="gmail_quote">On Thu, Aug 23, 2012 at 2:16 PM, Brian Davis <span dir="ltr">&lt;<a href="mailto:bitminer@gmail.com" target="_blank">bitminer@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for the response on this, I was able to get this to work (to 
degrees) with libtiff and Jasper as well as other non CMake-a-fied 
projects.  I have run into another issue where I wish to use 
configure_file to generate a CMakeLists.txt file in the directory where 
ExternalProject_add dumps the source and looks for the CMakeLists.txt 
file.   <br>
<br>
The problem is that I cannot configure_file at CMakeLists.txt.config 
file into a CMakeLists.txt file in the source directory where 
ExternalProject_Add will later look for it as ExternalProject_Add 
removes the file and generates the error:<br>
<br>
CMake Error: The source directory 
&quot;D:/projects/glade/branches/glade_win_x64/source/libtiff&quot; does not 
appear to contain CMakeLists.txt.<br>
<br>
Clicking the Generate button in CMake creates the CMakeLists.txt file 
and the ExternalProject_Add works just fine, but requires going back and
 clicking generate in CMake<br>
<br>
I think my options are currently to run patch (not as powerful as 
configure_file) using PATCH_COMMAND which as I recall is not in on Win 
boxes and for which I have used GNUWin32 or possibly the 
CONFIGURE_COMMAND.  Maybe I should recursively call CMake to 
configure_file the CMakeLists.txt file?  <br>
<br>
Thanks,<br>
<br>
Brian<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">On Sun, Jun 17, 2012 at 2:10 PM, David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

You could use:<div><span style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">  BUILD_COMMAND nmake /f <a href="http://makefile.vc/" style="color:rgb(17,85,204)" target="_blank">makefile.vc</a></span></div>



<div><font color="#222222" face="arial, sans-serif"><span style="border-collapse:collapse">  BUILD_IN_SOURCE 1<br></span></font><br></div><div>in your ExternalProject_Add call.</div>
<div><br></div><div>&quot;nmake&quot; is already available from within the Visual Studio environment.</div><div><br></div><div>Of
 course, if your project is cross-platform, you&#39;ll have to 
conditionalize this so that it only happens when using a Visual Studio 
or NMake generator.</div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><br>

</blockquote></div><br>
</div></div><br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>