On Wednesday 16 December 2009 04:05:22 pm Brad King wrote: > 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
What about adding a custom build phase and insert it before the "Compile Sources" build phase? <http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/200- Build_Phases/bs_build_phases.html> Clint _______________________________________________ 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