[Qbs] How to provide an "export" header

Björn Schäpers qt-maillist at hazardy.de
Sat Jul 13 13:13:58 CEST 2024


Am 13.07.2024 um 02:15 schrieb Иван Комиссаров:
>
>> 12 июля 2024 г., в 23:24, Björn Schäpers<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/d294f549/attachment.htm>


More information about the Qbs mailing list