[QBS] Multiple products, sharing the same settings, within single .qbs file

Christian Kandeler christian.kandeler at qt.io
Thu Aug 25 10:48:49 CEST 2016


On 08/25/2016 01:11 AM, Andrzej Telszewski wrote:
> Is it possible to have multiple products, with common settings, in
> single qbs file?
> 
> Say, something like:
> 
> Project {
>     Settings {
>         cpp.warningLevel: "all"
>         cpp.cxxLanguageVersion: "gnu99"
>     }
> 
>     Product {
>         SomehowReference: Settings
>         name: "p1"
>         files: "p1.c"
>     }
> 
>     Product {
>         SomehowReference: Settings
>         name: "p2"
>         files: "p2.c"
>     }
> }
> 
> I would love to have all of this in a single file.

Project {
    Product {
        name: "settings"
        Export {
            Depends { name: "cpp" }
            cpp.warningLevel: "all"
            cpp.cxxLanguageVersion: "gnu99"
        }
    }
    Product {
        Depends { name: "settings" }
        name: "p1"
        files: "p1.c"
    }
    Product {
        Depends { name: "settings" }
        name: "p2"
        files: "p2.c"
    }
}


Christian



More information about the Qbs mailing list