<p style="padding:0 0 0 0; margin:0 0 0 0;">Thanks for the clarification Christian and Joerg! I am looking forward to the new version. Let me know if I could help in any way like testing out some specific features or so. I like Qbs and what it can do. :-)</p>

<p style="padding:0 0 0 0; margin:0 0 0 0;">Michael</p>

<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: Christian Kandeler <christian.kandeler@qt.io><br />
> Komu: qbs@qt-project.org<br />
> Datum: 26.07.2017 10:39<br />
> Předmět: Re: [Qbs] Relation between Product and Export<br />
></p>

On Tue, 25 Jul 2017 21:13:06 +0200<br />
 <resurrection@centrum.cz> wrote:<br />
 <br />
 > I think I have another possible issue that you may be aware of as well (or I am just missing something). The Export item is a great way to control what the items that use the Product that defined it recieve. While that direction works pretty well I have major<br />
 > problems using the properties defined inside the Export in the Product that defined it. E.g.:<br />
 >  <br />
 > Product {<br />
 >     Export {<br />
 >         Depends { name: "cpp" }<br />
 >         cpp.includePaths: "include/"<br />
 >     }<br />
 >     cpp.defines: MY_SHARED_LIB<br />
 > }<br />
 >  <br />
 > This will emit warning that I use "cpp" without depending on it (located on the Product). <br />
 <br />
 Correct. The dependencies and properties of the Export item and those of the containing product are entirely distinct. <br />
 <br />
 >The same warning (located to Export) will happen when I put the Depends before Export. Now as per documentation to access the variable defined outside of Export one has to use "product.cpp." that seems to work <br />
 <br />
 The canonical way is to use a shared variable, since you generally do not want to export all your properties (as you've noted yourself):<br />
 <br />
 Product {<br />
    // ...<br />
    property stringList exportedDefines: ["X"]<br />
    property stringList privateDefines: ["Y"]<br />
    property stringList commonDefines: ["Z"]<br />
    cpp.defines: commonDefines.concat(privateDefines)<br />
    Export {<br />
        // ...<br />
        cpp.defines: product.commonDefines.concat(product.exportedDefines)<br />
    }<br />
 }<br />
 <br />
 Note how the defines set in the Export item are not a subset of the ones in the product, nor vice versa.<br />
 Do *not* ever export product.cpp.* (whether it seems to work or not), as these are fully expanded properties, meaning they potentially contain values that were not set in the product directly, but in modules that the product (but not the Export item) depends on. That's asking for trouble.<br />
    <br />
 > Another issue that is linked to this one and likely of the same cause (whether it is a (known) bug or WAD) that other Depends { name: "SomeOtherProduct" } or event Depends { name: "Qt"; submodules: "widgets"; } are NOT accessible in the same Product. E.g.:<br />
 >  <br />
 > Product {<br />
 >     Export {<br />
 >         Depends { name: "Qt.core" }<br />
 >         Depends { name: "cpp" }<br />
 >         cpp.includePaths: "include/"<br />
 >     }<br />
 >     cpp.defines: MY_SHARED_LIB<br />
 > }<br />
 >  <br />
 > Will provide access to Qt Core to whomever Depends on that Product but it does NOT provide access to it to this Product itself. Again, a workaround is to Depend on it outside of Export as well. How am I supposed to set these properties as exportable while having them available inside the defining Product? Ideally without duplicating the same code which I find rather silly.<br />
 <br />
 As Jörg has indicated, there are some ideas of how to make this more convenient, e.g. by adding a property to the Depends item indicating whether or not it should be automatically exported.<br />
 <br />
 <br />
 Christian<br />
 _______________________________________________<br />
 Qbs mailing list<br />
 Qbs@qt-project.org<br />
 <a href="http://lists.qt-project.org/mailman/listinfo/qbs">http://lists.qt-project.org/mailman/listinfo/qbs</a><br />