[Qbs] Any novice tickets

Christian Kandeler Christian.Kandeler at qt.io
Mon Dec 10 10:44:21 CET 2018


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


More information about the Qbs mailing list