<div class="gmail_quote">On Wed, Dec 16, 2009 at 6:16 PM, Clinton Stimpson <span dir="ltr"><<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>></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>
> Clinton Stimpson wrote:<br>
> > It looks like a bug in the Xcode generator.<br>
> > Here's an even simpler example:<br>
> ><br>
> > project(test_xcode)<br>
> ><br>
> > add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/test.h<br>
> > COMMAND cp ${CMAKE_SOURCE_DIR}/<a href="http://test.h.in" target="_blank">test.h.in</a> ${CMAKE_BINARY_DIR}/test.h<br>
> > DEPENDS ${CMAKE_SOURCE_DIR}/<a href="http://test.h.in" target="_blank">test.h.in</a><br>
> > )<br>
> ><br>
> > include_directories(${CMAKE_BINARY_DIR})<br>
> ><br>
> > add_executable(test_xcode<br>
> > ${CMAKE_BINARY_DIR}/test.h<br>
> > ${CMAKE_SOURCE_DIR}/<a href="http://test.h.in" target="_blank">test.h.in</a><br>
> > main.cpp)<br>
> ><br>
> > I have to hit build twice if <a href="http://test.h.in" target="_blank">test.h.in</a> is modified.<br>
><br>
> This is a known limitation, and it is very hard to fix because<br>
> Xcode does not provide real custom command support. It only<br>
> provides "shell script" build phases which we use to drive a<br>
> Makefile system that has the real custom commands. Currently<br>
> the projects that CMake generates do not convince Xcode to<br>
> run the shell script build phase at the right time in all cases.<br>
><br>
> See CMake's BuildDepends test:<br>
><br>
><br>
> <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>
>revision=1.14&root=CMake&view=markup<br>
><br>
> Note the "HELP_XCODE" blocks.<br>
><br>
> -Brad<br>
<br>
</div></div>What about adding a custom build phase and insert it before the "Compile<br>
Sources" build phase?<br>
<br>
<<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>><br><br></blockquote><div><br></div><div>Generated Xcode projects do use "Run Script" build phases... Perhaps there'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 "<a href="http://test.h.in">test.h.in</a>" 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's already a bug tracker entry about it...)</div><div><br></div><div><br></div>