[Qbs] How to provide an "export" header

Иван Комиссаров abbapoh at gmail.com
Sat Jul 13 15:26:42 CEST 2024


You can add it once to the base item of the products (possibly with some customisation using a prop). Usually there is already such an item in every product.

Ivan

> 13 июля 2024 г., в 14:13, Björn Schäpers <qt-maillist at hazardy.de> написал(а):
> 
> Am 13.07.2024 um 02:15 schrieb Иван Комиссаров:
>> 
>>> 12 июля 2024 г., в 23:24, Björn Schäpers <qt-maillist at hazardy.de> <mailto:qt-maillist at hazardy.de> написал(а):
>>> 
>>> Hi,
>>> 
>>> I have multiple dynamic libraries in my project tree, and use an export header similar to your qbs_export.h. Overtime the style of those headers had changed a bit and recently I replaced them by something generated from qbs. I generated them in the source directory, so that #include "export.hpp" just worked and even worked for the depending products.
>>> 
>>> Now (since 67af0c9517b01c482f425a6761b1cf38c486d3c3) that's not possible anymore, I understand the reasoning, but now I don't know how to solve the issue. If I generate the file in the build directory I'd have to add it to the include path, that's easy from the module. But how to add it to the include path from products depending on the dynamic library? And even further on products depending on those? The header did just propagate indefinitely, is there a way to achieve similar things with properties? In that case I even would exchange the header with just cpp.defines.
>> That’s what Export item for
>> 
>> DynamicLibrary {
>>     // library stuff here
>>     Export {
>>          Depends { name: «cpp» }
>>          cpp.includePaths: FileInfo.joinPaths(exportingProduct.buildDirectory, «path», «to», «headers»)
>>     }
>> }
>> 
> 
> I know what Export does, but the point is, I have to add that to all my 50+ products.
> Although I've had an error in my thoughts. Of course this will work.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20240713/5eaeab35/attachment-0001.htm>


More information about the Qbs mailing list