[Qbs] How to provide an "export" header

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



> 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 similar problem, but not to propagate stuff, will occur for my translation stuff. I made a rule to update the *.ts files when a cpp is changed, and of course I want to commit the translation files and thus they are in the source directory. How about that? As far as I know there is no official support for lupdate within qbs, right?

Good point actually, we kinda missed that.



More information about the Qbs mailing list