[CMake] dependency hell with custom commands and multiple outputs

Romain CHANU romainchanu at gmail.com
Mon Jan 18 10:33:58 EST 2010


Thank you for your explanations.

It makes sense indeed. I will try what you have suggested before and see how
it goes.

Thank you again for your help.

Cheers,

2010/1/18 David Cole <david.cole at kitware.com>

> 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/b99bc2f3/attachment.htm>


More information about the CMake mailing list