Did you build yet?<div><br></div><div>Custom commands are executed at build time, not at cmake configure time.</div><div><br><br><div class="gmail_quote">On Thu, Jul 1, 2010 at 3:21 PM, Hicham Mouline <span dir="ltr">&lt;<a href="mailto:hicham@mouline.org">hicham@mouline.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">








<div lang="EN-GB" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I added the -E, no difference.</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Shouldn&#39;t an error have been printed the first time round when I
didn&#39;t have the -E.  There was no error.</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I traced it and the ADD_CUSTOM_COMMAND was in the trace.</span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Is this an indication that line is not executed at all?</span></p><div class="im">

<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>

<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">

<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt">From:</span></b><span lang="EN-US" style="font-size:10.0pt"> David Cole [mailto:<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>] <br>

<b>Sent:</b> 01 July 2010 19:58<br>
<b>To:</b> Hicham Mouline<br>
<b>Cc:</b> <a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a><br>
<b>Subject:</b> Re: [CMake] generating source files with ADD_CUSTOM_COMMAND</span></p>

</div>

<p class="MsoNormal"> </p>

</div><div>

<p class="MsoNormal">I think you mean:</p>

</div><div class="im">

<div>

<p class="MsoNormal">${CMAKE_COMMAND} -E copy src dst</p>

</div>

<div>

<p class="MsoNormal"> </p>

</div>

<div>

<p class="MsoNormal">You forgot the -E.</p>

</div>

<div>

<p class="MsoNormal"> </p>

</div>

<div>

<p class="MsoNormal"> </p>

<div>

<p class="MsoNormal">On Thu, Jul 1, 2010 at 2:38 PM, Hicham Mouline &lt;<a href="mailto:hicham@mouline.org" target="_blank">hicham@mouline.org</a>&gt; wrote:</p>

<p class="MsoNormal">Hello<br>
<br>
I&#39;m trying to generate source files .cxx and include them in ADD_LIBRARY to<br>
build a static library, according to<br>
<a href="http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_generate_a_source_file_during_" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_generate_a_source_file_during_</a><br>
the_build.3F<br>
<br>
#<br>
# Copy template source files to *.cxx and place them in the build dir<br>
#<br>
ADD_CUSTOM_COMMAND(<br>
 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/name.cxx<br>
${CMAKE_CURRENT_BINARY_DIR}/widget.cxx<br>
 COMMAND ${CMAKE_COMMAND} copy<br>
${CMAKE_SOURCE_DIR}/systems/template_name.cpp<br>
${CMAKE_CURRENT_BINARY_DIR}/name.cxx<br>
 COMMAND ${CMAKE_COMMAND} copy<br>
${CMAKE_SOURCE_DIR}/systems/template_widget.cpp<br>
${CMAKE_CURRENT_BINARY_DIR}/widget.cxx<br>
 DEPENDS ${CMAKE_SOURCE_DIR}/template_name.cpp<br>
${CMAKE_SOURCE_DIR}/systems/template_widget.cpp<br>
)<br>
<br>
<br>
</p>

</div>

<p class="MsoNormal"> </p>

</div>

</div></div>

</div>


</blockquote></div><br></div>