[CMake] dependency hell with custom commands and multiple outputs

David Cole david.cole at kitware.com
Mon Jan 18 10:31:32 EST 2010


On Mon, Jan 18, 2010 at 10:14 AM, Romain CHANU <romainchanu at gmail.com>wrote:

> Yes I knew for the GENERATED option.
>
> This solution is a good work-around but still, it would be nice if CMake
> could handle the situation this way:
>
> # Generate Java / XML binding files
> add_custom_command(
>   OUTPUT  ${CMAKE_CURRENT_BINARY_DIR}/src/*.java
>   COMMAND ${JAVA_PATH}/xjc ${CMAKE_SOURCE_DIR}/xsd/*.xsd
>   DEPENDS ${CMAKE_SOURCE_DIR}/xsd/*.xsd
>   COMMENT "Invoking xjc to generate Java binding files")
>
> The OUTPUT, DEPENDS could handle regex strings.
>
> What do you think?
>

I think you don't realize what you're asking for here... You're basically
asking cmake to analyze a set of directories for an unknown set of files for
a single custom command invocation **every time you type "make" ** -- we
intentionally do not support this scenario for performance reasons.

We try to keep the "do nothing make" case as fast as possible and this sort
of feature would have a negative impact on that performance.

File DEPENDS sets must be explicit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100118/d880b65e/attachment.htm>


More information about the CMake mailing list