diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-04-29 13:42:37 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-05-08 11:01:44 +0200 |
commit | 5c9f1751336a94542c31cf10c4055e4e5fc7ed8c (patch) | |
tree | 64f8c266583b6724d3eb5a9556d8344e574a736f /qbs | |
parent | 65ee566183d4afe59c92ddcc846ec0588c81c39a (diff) |
qbs build: Make the autotest template available as an import.
Just like for QtcPlugin, QtcLibrary etc.
Change-Id: I395f5863f31abba589864be3ad41ad7fc893787f
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Diffstat (limited to 'qbs')
-rw-r--r-- | qbs/imports/QtcAutotest.qbs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/qbs/imports/QtcAutotest.qbs b/qbs/imports/QtcAutotest.qbs new file mode 100644 index 0000000000..36817c43e8 --- /dev/null +++ b/qbs/imports/QtcAutotest.qbs @@ -0,0 +1,33 @@ +import qbs +import qbs.FileInfo +import QtcFunctions + +CppApplication { + type: "application" + Depends { name: "Qt.test" } + targetName: "tst_" + name.split(' ').join("") + + // This needs to be absolute, because it is passed to one of the source files. + destinationDirectory: buildDirectory + '/' + + FileInfo.relativePath(project.ide_source_tree, sourceDirectory) + + cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs) + cpp.rpaths: [ + buildDirectory + '/' + project.ide_library_path, + buildDirectory + '/' + project.ide_library_path + "/..", // OSX + buildDirectory + '/' + project.ide_plugin_path + "/QtProject" + ] + + // 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. +// cpp.rpaths: qbs.targetOS.contains("osx") +// ? ["@executable_path/.."] +// : ["$ORIGIN/../" + project.libDirName + "/qtcreator", +// "$ORIGIN/../" project.libDirName + "/qtcreator/plugins/QtProject"] +// Group { +// fileTagsFilter: product.type +// qbs.install: true +// qbs.installDir: project.ide_bin_path +// } +} |