[QBS] Artifact filePath

Christian Kandeler christian.kandeler at digia.com
Mon Oct 20 16:54:04 CEST 2014


On 10/20/2014 04:32 PM, Kurt Keller wrote:
> What would be the best way, to define the property 'filePath'
> for generated artifacts like header files (xxx.h) in a manner which
> does not depend on qbs implementation details.
>
> Background: In pre 1.3.2 versions qbs included automatically the
> option '-I .../GeneratedFiles/<productname>' when calling the compiler.

No, it did not. The Qt module added this path to the list of include 
paths because it knows that some headers it generates will end up there.

> So I have put my generated include files there.

That was a mistake. The exact value of that path is an implementation 
detail and can change at any time. If your module (or product) generates 
headers, then your module (or product) is responsible for making these 
available to whoever is going to include them.
For example: You have a module with a rule that creates a header file:
     Artifact { filePath: "includes/header.h" }
Now your module needs to adapt the list of include paths as well:
     cpp.includePaths: product.buildDirectory + "/includes"
For products it's basically the same, with the cpp.includePaths property 
in an Export block if the headers should be accessible from dependent 
products.


Christian



More information about the Qbs mailing list