<div dir="ltr"><div><div><div><div><div><div><div><div><div><span style="white-space:pre-wrap"></span><span style="color:rgb(128,128,0)">> property</span><span style="color:rgb(192,192,192)"> </span>stringList<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">myIncludePaths</span>:<span style="color:rgb(192,192,192)"> </span>[ <font color="#008000">path</font><span style="color:rgb(192,192,192)"> </span>]<br>> But I read in the mail list that using path is deprecated.<br>> What is the future way to go? Using sourceDirectory?<br><br></div>Even though "path" is deprecated now, its functionalitiy will available in the future. You just have to migrate to whatever the coming Qbs versions will provide as a replacement.<br><br>> I have for example application A which depend on static<br>> library B and C. Static library B depends on static library C.<br>> No problem yet but now static library C depends on B.<br>> [...] Mostly they are configuration dependenties.<br><br></div>So I would try merging all these configuration dependencies in one place, and let A, B and C depend on them. A very simple approach would be to introduce a common product, which exports the configuration stuff.<br><br></div>--- RTOS.qbs ---<br></div>import qbs 1.0<br></div>Product {<br></div>    Export {<br></div>        Depends { name: "cpp" }<br></div>        cpp.includePaths: ...<br></div>        cpp.defines: ...<br><div><div><div>    }<br><div>}<br><div><div><div><div><div><div><div><div><div><div><div><br></div><div>Now let A, B and C depend on RTOS. You can even consider adding project level properties in the exported stuff (haven't tried this, but I think it should work). Or, consider Richards approach, which also sounds very good.<br></div><div><br><div style="word-wrap:break-word"><div>> The property as you proposed is a nice solution with the<br>> current implementation of qbs. The drawback is that<br>> independent projects like a RTOS, or libraries supporting<br>> qbs have to also support my naming convention of the properties.</div></div><div><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Of course it has to be done the other way round. The generic product has to provide a solution, and you have to adopt to it. So your RTOS could define a set of properties which it expects to be available at project level (e.g. rtosIncludePaths, rtosDefines, rtosCxxFlags, ...). They can even check if these properties exist and react accordingly, e.g. by using JavaScript like if (project.rtosDefines === undefined).<br></div><div> <br>> What if you have application A which is depending on static<br>> library B. Now you have a define in your code and in the<br>> library code to disalbe a certain feature like: [...]<br><br></div><div>You could either depend both A and B on a common product like Features.qbs, which exports the defines you need. Or, define the features on project level and let A and B query them. Here's a sketch for the latter:<br><br></div><div>--- Project.qbs ---<br>import qbs 1.0<br>Project {<br></div><div>    property bool hasFeatureA: true<br></div><div>    property bool hasFeatureB: false<br></div><div>}<br><div><br></div><div>--- A.qbs ---<br>import qbs 1.0<br>Application {<br></div><div>    Depends { name: "cpp" }<br></div><div>    cpp.defines: {<br></div><div>        var defs = [ ]<br></div><div>        if (!project.hasFeatureA)<br>            defs.push("DISABLE_FEATURE_A")<br>        ...<br></div><div>        return defs<br></div><div>    }<br></div><div>}<br></div><div><br></div></div><div><div>--- B.qbs ---<br>import qbs 1.0<br>StaticLibary {<br></div><div>    Depends { name: "cpp" }<br></div><div>    cpp.defines: {<br></div><div>        var defs = [ ]<br></div><div>        if (!project.hasFeatureA)<br>            defs.push("DISABLE_FEATURE_A")<br>        ...<br></div><div>        return defs<br></div><div>    }<br></div><div>}<br></div><div><br></div>Regards,<br></div><div>Thomas<br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>