On Sep 13, 2016, at 12:10 PM, Christian Kandeler 
<christian.kande...@qt.io<mailto:christian.kande...@qt.io>> wrote:

[Sorry about the formatting, using outlook]

Stephen Kelly wrote:
> Here's the CMake version:

[ ... ]

>      execute_process(
>       COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/generator.py --list
> ${CMAKE_CURRENT_BINARY_DIR}/genoutput 5
>       OUTPUT_VARIABLE fileList
>     )

How do you know where the input file is located?

> However, it is cheating in the same way that the QBS version from
> Christian is cheating - it assumes '--list' exists:

Yes, I was assuming a cooperating tool.

> Christian, can you create a version which does not require --list?

There are two possibilities:
a) The inner workings of the tool are known and "simple enough". That's the 
case in Bo's example, so there we could just open the input file and derive the 
output artifacts from the number we find there.
b) Otherwise, our outputArtifacts script has to run the tool in "real mode" 
(using the "--generate" option). The actual command would be a no-op then. This 
is icky, both conceptually and for practical reasons, because commands of 
non-competing rules are run in parallel, whereas the outputArtifacts scripts 
are not. I think so far we only use this approach for the infamous qdoc tool.

And asset catalogs, XIBs/NIBs/storyboards, Java sources, and TypeScript sources.



Christian
_______________________________________________
Development mailing list
Development@qt-project.org<mailto:Development@qt-project.org>
http://lists.qt-project.org/mailman/listinfo/development

--
Jake Petroules - jake.petrou...@qt.io<mailto:jake.petrou...@qt.io>
Consulting Services Engineer - The Qt Company
Qbs build tool evangelist - qbs.io<http://qbs.io>

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to