aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/qtscxml/qtscxml.qbs
blob: af96b8594a69c4f245eb0e325d40ba999e1844a6 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import qbs
import qbs.FileInfo

Project {
    QtApplication {
        name: "app"
        Depends { name: "Qt.scxml"; required: false }

        Properties {
            condition: Qt.scxml.present
            cpp.defines: ["HAS_QTSCXML"]
        }

        Qt.scxml.className: "QbsStateMachine"
        Qt.scxml.namespace: "QbsTest"

        files: ["main.cpp"]
        Group {
            files: ["dummystatemachine.scxml"]
            fileTags: ["qt.scxml.compilable"]
        }
    }

    Product {
        name: "runner"
        type: ["runner"]
        Depends { name: "app" }
        Rule {
            inputsFromDependencies: ["application"]
            Artifact {
                filePath: "dummy"
                fileTags: ["runner"]
            }
            prepare: {
                var cmd = new Command(input.filePath);
                cmd.description = "running " + input.filePath;
                var pathVar;
                var pathValue;
                if (product.moduleProperty("qbs", "hostOS").contains("windows")) {
                    pathVar = "PATH";
                    pathValue = FileInfo.toWindowsSeparators(
                                input.moduleProperty("Qt.core", "binPath"));
                } else {
                    pathVar = "LD_LIBRARY_PATH";
                    pathValue = input.moduleProperty("Qt.core", "libPath");
                }
                cmd.environment = [pathVar + '=' + pathValue];
                return [cmd];
            }
        }
    }
}