Clinton Stimpson wrote:
> It looks like a bug in the Xcode generator.
> Here's an even simpler example:
> 
> project(test_xcode)
> 
> add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/test.h
>     COMMAND cp ${CMAKE_SOURCE_DIR}/test.h.in ${CMAKE_BINARY_DIR}/test.h
>     DEPENDS ${CMAKE_SOURCE_DIR}/test.h.in
>     )
> 
> include_directories(${CMAKE_BINARY_DIR})
> 
> add_executable(test_xcode
>     ${CMAKE_BINARY_DIR}/test.h
>     ${CMAKE_SOURCE_DIR}/test.h.in
>     main.cpp)
> 
> I have to hit build twice if test.h.in is modified.

This is a known limitation, and it is very hard to fix because
Xcode does not provide real custom command support.  It only
provides "shell script" build phases which we use to drive a
Makefile system that has the real custom commands.  Currently
the projects that CMake generates do not convince Xcode to
run the shell script build phase at the right time in all cases.

See CMake's BuildDepends test:

  
http://www.cmake.org/cgi-bin/viewcvs.cgi/Tests/BuildDepends/CMakeLists.txt?revision=1.14&root=CMake&view=markup

Note the "HELP_XCODE" blocks.

-Brad
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to