<div dir="ltr">Thanks for advise, Dmitry.<div><br></div><div>I've tried and id doesn't work.</div><div>Same problem...</div><div>I simplified test case. So now it's just qbs/examples/app-and-lib with one extra header file.</div><div><br></div><div>----------------------------------</div><div><div>anpilog@Andriis-MacBook-Pro.local:~/git/cmake/test</div><div>➜ qbs profile:gcc</div><div>Restoring build graph from disk</div><div>Building for configuration gcc-debug</div><div>compiling main.cpp</div><div>ERROR: /usr/bin/g++ -m64 -g -Wall -Wextra -pipe -fvisibility=default -fPIC -c /Users/anpilog/git/cmake/test/app/main.cpp -o /Users/anpilog/git/cmake/test/gcc-debug/app-and-lib-app.gcc/.obj/main.cpp.o</div><div>/Users/anpilog/git/cmake/test/app/main.cpp:2:10: fatal error: 'lib.h' file not found</div><div>#include "lib.h"</div><div>         ^</div><div>1 error generated.</div><div>ERROR: Process failed with exit code 1.</div><div>The following products could not be built for configuration gcc-debug:</div><div><span class="" style="white-space:pre">       </span>app-and-lib-app</div></div><div>----------------------------------<br><div><br></div></div><div>Include folders from lib/lib.qbs are not passed to app/app.qbs.</div><div><br></div><div>Besides I would expect some configurable way what headers to share from product...</div><div><br></div><div>It's still confusing me a lot.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-07 15:19 GMT+08:00 Dmitry Volosnykh <span dir="ltr"><<a href="mailto:dmitry.volosnykh@gmail.com" target="_blank">dmitry.volosnykh@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Andrey, I would suggest you to extract your "project" to a separate .qbs file. So that your top-level qbs looks like below:<br><br><div>import qbs<br><br>Project {<br>    references: [<br>        "app/app.qbs",<br>        "lib/lib.qbs"<br>    ]<br>}</div><div><br></div><div>Then in the app.qbs do:</div><div><br></div><div>Depends { name: "lib" }</div><div><br></div><div>Such setup works for me.</div><div><br></div><div>PS. Don't know if mixing references with direct Product declarations is good to go... Documentation says nothing about it.</div>
</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Jan 7, 2015 at 9:59 AM, Andrey Anpilogov <span dir="ltr"><<a href="mailto:anpilog@gmail.com" target="_blank">anpilog@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div dir="ltr"><div>Hi,</div><div><br></div><div>I'm investigating qbs as possible replacement to Makefiles in my project.</div><div>And it looks good except one thing: how to add include path from product to product?</div><div><br></div><div>Let's take an example:</div><div><br></div><div>project.qbs</div><div>---------------------------------------------</div><div><div>import qbs 1.0</div><div><br></div><div>Project {<br></div><div>  references: [</div><div>      "lib/build.qbs"</div><div>  ]</div><div><br></div><div>  Product {</div><div>    name: "project"</div><div>    type: "application"</div><div>    files: "main.cpp"</div><div>    Depends { name: "lib" }</div><div>    Depends { name: "cpp" }</div><div>  }<br></div><div>}</div></div><div><div>---------------------------------------------</div><div></div></div><div><br></div><div>lib/build.qbs</div><div><div>---------------------------------------------</div><div><div><div>import qbs 1.0</div><div><br></div><div>Product {</div><div>   name: "lib"<br></div><div>   type: "staticlibrary"</div><div><br></div><div>   files: ["file1.cpp", "file2.cpp"]</div><div>   cpp.includePaths: ["api", "ppi", "xdi"]</div><div>   cpp.defines:          ["xxx", "zzz"]</div><div>   cpp.cxxFlags:       ["xxx", "zzz"]</div><div>   cpp.cFlags:           ["xxx", "zzz"]</div><div>   cpp.commonCompilerFlags: ["-Os", "-gdwarf-2", "-Wall"]</div><div>   cpp.linkerScripts: "xxx"</div><div>   Depends { name: "cpp" }</div><div>}</div></div><div>---------------------------------------------</div><div><br></div><div>It's quite similar to qbs/examples/app-and-lib example.</div><div>The problem is that project/main.cpp can't include headers from 'lib' folder due to qbs doesn't add any include path from product:lib.</div><div>I've looked over docs and cpp profile and could not find anything better then manually add includes into application product:</div><div><br></div><div><div>---------------------------------------------</div><div>import qbs 1.0<br></div><div>Project {<br></div><div>  references: [ "lib/build.qbs" ]</div><div><br></div><div>  Product {</div><div>    name: "project"</div><div>    type: "application"</div><div>    //...</div><div>    cpp.includePaths: "lib"</div><div>  }<br></div><div>}</div></div><div><div>---------------------------------------------</div></div><div><br></div><div>And it looks quite strange to me. If I add reference and make product depended from other product I would expect I can pass not only static libraries to dependant product but also headers path...</div><div><br></div><div>Or there is some other approach?</div><div><br></div><div>Regards.</div><div></div></div><div></div></div></div></div>
</div>
<br></div></div>_______________________________________________<br>
QBS mailing list<br>
<a href="mailto:QBS@qt-project.org" target="_blank">QBS@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/qbs" target="_blank">http://lists.qt-project.org/mailman/listinfo/qbs</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">-- <br>WBR,<br>  Andrii Anpilogov<br>  Phone: +86 186-1660-3720<br>  Skype: anpilogov.andrey<br>  mailto:<a href="mailto:anpilog@gmail.com" target="_blank">anpilog@gmail.com</a>, <a href="mailto:andrii.anpilogov@mesheven.com" target="_blank">andrii.anpilogov@mesheven.com</a><br><div><img src="http://qrcoder.ru/code/?BEGIN%3AVCARD%0AN%3AAnpilogov%3BAndrey%0AORG%3ACraneMS%0ATITLE%3Asenior+software+developer%2Fteam+Leader%0ATEL%3A%2B380675455666%0AEMAIL%3Aanpilog%40gmail.com%0ANOTE%3AEmbedded+Software+Development%2C+C%2FC%2B%2B%2C+team+leadership%0AEND%3AVCARD&3&0"><br></div></div></div>
</div>