[QBS] How to get path informations

Joerg Bornemann joerg.bornemann at nokia.com
Mon Feb 20 11:01:03 CET 2012

On 19/02/2012 04:12, ext Mathieu Bouchard wrote:

> Just found out that I was supposed to use Properties instead of Groups.
> But appending librairies to cpp.dynamicLibraries still doesn't work. I
> think I should wait for the official documentation to be ready! :)

The Group item is for changing the configuration of a group of files.

// turns off optimization for file1.cpp and file2.cpp
Group {
     // optional condition
     files: ['file1.cpp', 'file2.cpp']
     cpp.optimization: "off"

Your groups do not contain files so it basically does nothing.
In that case we should yield an error.

Using the Properties item should work though.

Properties {
    condition: sharedSsl == true
    cpp.dynamicLibraries: ["eay32", "ssl32"]

What not works is the following:

// [1]
cpp.dynamicLibraries: ["somelib"]

Properties {
    condition: sharedSsl == true
    // [2]
    cpp.dynamicLibraries: ["eay32", "ssl32"]

The binding [1] would be unconditional and [2] would be a second binding 
to the same property, if sharedSsl is true.
There cannot be more than one binding to a property.
Are you hitting that case?

To solve this you can have a more complex binding:
cpp.dynamicLibraries: {
     var libs = ["somelib"]
     if (sharedSsl)
         libs = libs.concat(['eay32', 'ssl32'])
         libs = libs.concat(['crypto', 'ssl'])
     return libs


More information about the Qbs mailing list