[CMake] qt .qrc file modifications require two builds

Brad King brad.king at kitware.com
Wed Dec 16 18:05:22 EST 2009


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


More information about the CMake mailing list