Actually.... I've just talked with Brad about this. This might be an issue with Visual Studio 10 itself rather than cmake or with whether or not you use full paths...<br><br>The generated project should have the same contents regardless of whether you use the full paths or not. If you could try both ways and then do a diff on the *.vcxproj files and let us know the results, that would be great. We expect them to be the same generated custom commands in full path and in non-full path cases.<br>
<br><br><div class="gmail_quote">On Fri, Apr 30, 2010 at 9:37 AM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>></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;">
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" target="_blank">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"><div><div></div><div class="h5">On Fri, Apr 30, 2010 at 5:28 AM, elizabeta petreska <span dir="ltr"><<a href="mailto:elizabeta.petreska@gmail.com" target="_blank">elizabeta.petreska@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">Hello<div><br><br>>>Can you create a VS project manually through the IDE in which<br>
>>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>
<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> COMMAND ${CMAKE_COMMAND} -E copy<br>
${PROJECT_SOURCE_DIR}/<a href="http://generated.txt.in/" target="_blank">generated.txt.in</a><br></div><div>
${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><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"><<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>></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>
> I am using Visual Studio 2010 generator and cmake 2.8.1<br>
> The example code you show, does work with Visual Studio 2005 generator<br>
> and visual studio 2008 generator , but does not work with Visual Studio<br>
> 2010 generator, i.e<br>
> If I touch the ${PROJECT_BINARY_DIR}/generated.txt, the target is not<br>
> 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></div></div><div class="im">_______________________________________________<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></div></blockquote></div><br>
</blockquote></div><br>