<div class="gmail_quote">On Wed, Dec 16, 2009 at 6:16 PM, Clinton Stimpson <span dir="ltr">&lt;<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Wednesday 16 December 2009 04:05:22 pm Brad King wrote:<br>
&gt; Clinton Stimpson wrote:<br>
&gt; &gt; It looks like a bug in the Xcode generator.<br>
&gt; &gt; Here&#39;s an even simpler example:<br>
&gt; &gt;<br>
&gt; &gt; project(test_xcode)<br>
&gt; &gt;<br>
&gt; &gt; add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/test.h<br>
&gt; &gt;     COMMAND cp ${CMAKE_SOURCE_DIR}/<a href="http://test.h.in" target="_blank">test.h.in</a> ${CMAKE_BINARY_DIR}/test.h<br>
&gt; &gt;     DEPENDS ${CMAKE_SOURCE_DIR}/<a href="http://test.h.in" target="_blank">test.h.in</a><br>
&gt; &gt;     )<br>
&gt; &gt;<br>
&gt; &gt; include_directories(${CMAKE_BINARY_DIR})<br>
&gt; &gt;<br>
&gt; &gt; add_executable(test_xcode<br>
&gt; &gt;     ${CMAKE_BINARY_DIR}/test.h<br>
&gt; &gt;     ${CMAKE_SOURCE_DIR}/<a href="http://test.h.in" target="_blank">test.h.in</a><br>
&gt; &gt;     main.cpp)<br>
&gt; &gt;<br>
&gt; &gt; I have to hit build twice if <a href="http://test.h.in" target="_blank">test.h.in</a> is modified.<br>
&gt;<br>
&gt; This is a known limitation, and it is very hard to fix because<br>
&gt; Xcode does not provide real custom command support.  It only<br>
&gt; provides &quot;shell script&quot; build phases which we use to drive a<br>
&gt; Makefile system that has the real custom commands.  Currently<br>
&gt; the projects that CMake generates do not convince Xcode to<br>
&gt; run the shell script build phase at the right time in all cases.<br>
&gt;<br>
&gt; See CMake&#39;s BuildDepends test:<br>
&gt;<br>
&gt;<br>
&gt; <a href="http://www.cmake.org/cgi-bin/viewcvs.cgi/Tests/BuildDepends/CMakeLists.txt" target="_blank">http://www.cmake.org/cgi-bin/viewcvs.cgi/Tests/BuildDepends/CMakeLists.txt</a>?<br>
&gt;revision=1.14&amp;root=CMake&amp;view=markup<br>
&gt;<br>
&gt; Note the &quot;HELP_XCODE&quot; blocks.<br>
&gt;<br>
&gt; -Brad<br>
<br>
</div></div>What about adding a custom build phase and insert it before the &quot;Compile<br>
Sources&quot; build phase?<br>
<br>
&lt;<a href="http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/200-
Build_Phases/bs_build_phases.html" target="_blank">http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/200-<br>
Build_Phases/bs_build_phases.html</a>&gt;<br><br></blockquote><div><br></div><div>Generated Xcode projects do use &quot;Run Script&quot; build phases... Perhaps there&#39;s a way we could specify input and output files for those build phases. Those bits of the UI seem to be empty when I inspect an Xcode project built from your &quot;<a href="http://test.h.in">test.h.in</a>&quot; example here.</div>
</div><div><br></div><div>This issue appears to be reporting the same thing...</div><div><br></div><div><a href="http://public.kitware.com/Bug/view.php?id=8291">http://public.kitware.com/Bug/view.php?id=8291</a><br></div>
<div><br></div><div>(So there&#39;s already a bug tracker entry about it...)</div><div><br></div><div><br></div>