Use full paths for all OUTPUT and DEPENDS args and try again.<br><br>i.e.<br> OUTPUT ${PROJECT_BINARY_DIR}/generated.txt<br> DEPENDS ${PROJECT_SOURCE_DIR}/<a href="http://generated.txt.in">generated.txt.in</a><br>

 ADD_CUSTOM_TARGET(${PROJECT_NAME} DEPENDS ${PROJECT_BINARY_DIR}/generated.txt)<br><br><br>Does it work then?<br><br><br><div class="gmail_quote">On Fri, Apr 30, 2010 at 5:28 AM, elizabeta petreska <span dir="ltr">&lt;<a href="mailto:elizabeta.petreska@gmail.com">elizabeta.petreska@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello<div class="im"><br><br>&gt;&gt;Can you create a VS project manually through the IDE in which<br>

&gt;&gt;this works correctly?<br><br></div>I add custom build step manually through VS10 dialog for the following cmake code , and it works as it should. But if I run this through cmake ( not manually ) it does not work:<div class="im">
<br><br>
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)<br>
PROJECT(quick_test)<br>
<br>
ADD_CUSTOM_COMMAND(<br>
  OUTPUT generated.txt<br>
</div><div><div class="im">  COMMAND ${CMAKE_COMMAND} -E copy<br>
   ${PROJECT_SOURCE_DIR}/<a href="http://generated.txt.in/" target="_blank">generated.txt.in</a><br></div><div class="im">
   ${PROJECT_BINARY_DIR}/generated.txt<br>
</div></div>  DEPENDS <a href="http://generated.txt.in/" target="_blank">generated.txt.in</a><br>
  )<br>ADD_CUSTOM_TARGET(${PROJECT_NAME} DEPENDS generated.txt)<br><br>What it seems odd is this : <br>If I change the name of the input file or the name od the output file , then it does work with cmake too.<br><br>Maybe this just my imagination can not tell for sure. My guess is maybe this has to do something that the output file ( generated.txt) is substring of the input file ( <a href="http://generated.txt.in" target="_blank">generated.txt.in</a> ). <br>

<br>Thank you<div><div></div><div class="h5"><br><br><br><br>
<br>
<br><br><div class="gmail_quote">On Wed, Apr 28, 2010 at 6:52 PM, Brad King <span dir="ltr">&lt;<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div>elizabeta petreska wrote:<br>
&gt;  I am using Visual Studio 2010 generator and cmake 2.8.1<br>
&gt; The example code you show, does work with Visual Studio 2005 generator<br>
&gt; and visual studio 2008 generator , but does not work with  Visual Studio<br>
&gt; 2010 generator, i.e<br>
&gt; If I touch the ${PROJECT_BINARY_DIR}/generated.txt, the target is not<br>
&gt; built anew.<br>
<br>
</div>Can you create a VS project manually through the IDE in which<br>
this works correctly?<br>
<font color="#888888"><br>
-Brad<br>
</font></blockquote></div><br>
</div></div><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>