QtcAutotest.qbs 1.36 KB
Newer Older
1 2 3
import qbs
import qbs.FileInfo

4
QtcProduct {
5
    type: ["application", "autotest"]
6
    Depends { name: "Qt.testlib" }
7
    Depends { name: "copyable_resource" }
8 9 10
    targetName: "tst_" + name.split(' ').join("")

    // This needs to be absolute, because it is passed to one of the source files.
Christian Kandeler's avatar
Christian Kandeler committed
11
    destinationDirectory: project.buildDirectory + '/'
12 13 14
                          + FileInfo.relativePath(project.ide_source_tree, sourceDirectory)

    cpp.rpaths: [
15 16
        project.buildDirectory + '/' + qtc.ide_library_path,
        project.buildDirectory + '/' + qtc.ide_plugin_path
17
    ]
18 19 20 21 22
    cpp.defines: base.filter(function(d) {
        return d !== "QT_RESTRICTED_CAST_FROM_ASCII"
            && d !== "QT_USE_FAST_OPERATOR_PLUS"
            && d !== "QT_USE_FAST_CONCATENATION";
    })
23

24 25 26 27 28
    Group {
        fileTagsFilter: product.type
        qbs.install: false
    }

29 30 31
    // The following would be conceptually right, but does not work currently as some autotests
    // (e.g. extensionsystem) do not work when installed, because they want hardcoded
    // absolute paths to resources in the build directory.
Christian Kandeler's avatar
Christian Kandeler committed
32
    //    cpp.rpaths: qbs.targetOS.contains("macos")
33
    //            ? ["@loader_path/../Frameworks", "@loader_path/../PlugIns"]
34 35
    //            : ["$ORIGIN/../" + qtc.libDirName + "/qtcreator",
    //               "$ORIGIN/../" qtc.libDirName + "/qtcreator/plugins"]
36
}