[CMake] Multiple custom commands depending on same file
Bill Hoffman
bill.hoffman at kitware.com
Wed Apr 22 21:52:58 EDT 2009
giuliano wrote:
> Indeed, both file-A.txt and file-B.txt are dependencies of one of my
> targets.
>
If you can create a full example that shows the problem, that would help.
-Bill
> giuliano
>
> Bill Hoffman wrote, on 4/21/2009 6:16 PM:
>> giuliano wrote:
>>> I have something like:
>>>
>>> ADD_CUSTOM_COMMAND(
>>> OUTPUT ${BUILD_FOLDER}/file-A.txt
>>> COMMAND ${XSLT}
>>> ARGS --output ${BUILD_FOLDER}/file-A.txt A.xslt
>>> file.xml
>>> DEPENDS file.xml A.xslt
>>> )
>>>
>>> ADD_CUSTOM_COMMAND(
>>> OUTPUT ${BUILD_FOLDER}/file-B.txt
>>> COMMAND ${XSLT}
>>> ARGS --output ${BUILD_FOLDER}/file-B.txt B.xslt
>>> file.xml
>>> DEPENDS file.xml B.xslt
>>> )
>>>
>>> When I run cmake, only file-A.txt is built. If I reverse the stanzas
>>> for file-A.txt and file-B.txt, then only file-B.txt is built.
>>>
>>> It seems as if only the first target that depends on a file gets
>>> built. How do I get cmake to build them all?
>>>
>>> I'm running cmake 2.4.
>>>
>> You need a custom target or other target to consume the outputs from
>> the custom commands.
>>
>> -Bill
>>
>
More information about the CMake
mailing list