[cmake-developers] custom_command rebuild output file when depend files change?

Robert Goulet Robert.Goulet at autodesk.com
Mon Jun 1 13:19:39 EDT 2015


Hi,

Does CMake custom_command rebuild the output file if the dependency files change? Seems like it should but I can't get it to work.

The CMake command is written like this:

                add_custom_command(
                                OUTPUT ${ OUTPUT_FILE}
                                COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${ OUTPUT_DIR}
                                COMMAND ${ BINARY} ARGS -output=${ OUTPUT_FILE}
                                                DEPENDS ${ INPUT_FILES}
                                                WORKING_DIRECTORY ${WORK_DIR}
                                                COMMENT "Generating stuff..."
                )

Is my custom_command badly written? The output gets properly generated the first time we build, but when we change the dependency files it doesn't. So far, the only way we got it to rebuild was to delete the output file.

Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150601/20d9c054/attachment.html>


More information about the cmake-developers mailing list