[Qbs] How to explicitly prohibit the use of qt-framework in project

Richard Weickelt richard at weickelt.de
Tue Oct 20 22:48:41 CEST 2020


>>     qbs build ...  moduleProviders.Qt.qmakeFilePaths:/invalid
> Yes, it works. But is it possible to do such a disconnection from the
> project itself?

You mean in the project files? You can do that only on Product level, not
for the entire project:

Project {
   // cannot set global moduleProvider here.


    CppApplication {
        // ....

        moduleProviders.Qt.qmakeFilePaths: "/invalid"
    }
}

> The fact is that I am developing a demo project, and I would like some
> products to be disabled when building, if the user does not have
> qt-framework installed.

I still don't get what you want to show. How Qbs behaves when Qt is not
found? You could also simply create two profiles:

1. with moduleProviders.Qt.qmakeFilePaths not set or set to a a valid path,
2. with moduleProviders.Qt.qmakeFilePaths set to invalid.

And then invoke Qbs with the two different profiles.


More information about the Qbs mailing list