[Qbs] Any novice tickets

Иван Комиссаров abbapoh at gmail.com
Mon Dec 10 15:12:55 CET 2018


I hope I could use inheritance, composition may require too many boilerplate code. Ok, thanks anyway.

Иван Комиссаров

> 10 дек. 2018 г., в 10:44, Christian Kandeler <Christian.Kandeler at qt.io> написал(а):
> 
> On Sun, 9 Dec 2018 20:29:58 +0100
> Иван Комиссаров <abbapoh at gmail.com> wrote:
> 
>> Ok, I’ve got another question. I would like to separate a protobuf.cpp module in 3 parts - the manual one, auto-detected by probes, and the auto-detected with pkgconfig.
>> But I’ve encountered a problem that I can’t use probes to detect if the module should be used, i.e. use them in the «condition» variable. The «found» property is false at that moment (but is true in validate)
>> 
>> ProtobufCppBase {
>>    priority: 75
>>    condition: includeProbe.found && libraryProbe.found
>>    // ...
>> }
> 
> That's not possible. Probes are evaluated after the module has been loaded, long after the condition has been evaluated.
> If you want to split up the module, I suppose it could be done using composition, i.e. introduce separate internal modules and conditionally load them from the main module:
>    Depends { name: "protobuf.cpp_pkgconfig"; required: false }
>    Depends { name: "protobuf.cpp_probes; condition: !protobuf.cpp_pkgconfig.present; required: false }
>    // etc
> 
> 
> Christian
> _______________________________________________
> Qbs mailing list
> Qbs at lists.qt-project.org
> https://lists.qt-project.org/listinfo/qbs



More information about the Qbs mailing list