On Fri, Jul 31, 2009 at 08:42:10AM -0400, Marc Schafer wrote:
> add_custom_target ( generated_messages ALL
> COMMAND
> ${ANT_EXECUTABLE} -f ${PROJECT_SOURCE_DIR}/java/MessageGenerator/build.xml
> run
> COMMAND
> ${CMAKE_COMMAND} -E copy_if_different ${DICTIONARY_DIR}/c/messages.h
> ${PROJECT_BINARY_DIR}/include/messages.h
> )
>
> This works fine on Linux and Mac with the make generator but does not work
> on Windows XP with the Visual studio 2008 generator. From the build log
> file, I can see that a batch file is getting generated with two commands:
> one to run ant and the other to do the copy. When the batch file is run,
> the ant command works fine, but the copy never seems to happen. My library
> fails to build because it can't find messages.h even though it does exist in
> ${DICTIONARY_DIR}/c/messages.h
I have run into this. Here's a note from our (internal) wiki:
"If invoking a DOS batch file you must precede the command with the call
keyword. Also, it must not have quotes surrounding the call and the
command."
Your ant "executable" is probably a batch file. For reasons I don't
remember, VS gets confused and likes to exit immediately after running a
batch file as a custom build step.
tyler
_______________________________________________
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