aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/pkg-config-probe/modules/themodule/themodule.qbs
blob: 81dfa955f65169ed88f965502b749874b5750af2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import qbs
import qbs.Probes

Module {
    property string packageName
    property string libDir

    Probes.PkgConfigProbe {
        id: theProbe
        name: packageName
        libDirs: [libDir]
    }

    property bool probeSuccess: theProbe.found
    property stringList libs: theProbe.libs
    property stringList cFlags: theProbe.cflags
    property string packageVersion: theProbe.modversion

    Rule {
        multiplex: true
        Artifact {
            filePath: "dummy.out"
            fileTags: ["theType"]
        }
        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.silent = true;
            cmd.sourceCode = function() {
                console.info(product.name + " found: " + product.themodule.probeSuccess);
                console.info(product.name + " libs: " + JSON.stringify(product.themodule.libs));
                console.info(product.name + " cflags: " + JSON.stringify(product.themodule.cFlags));
                console.info(product.name + " version: " + product.themodule.packageVersion);
            }
            return [cmd];
        }
    }

}