aboutsummaryrefslogtreecommitdiffstats
path: root/qbs
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-05-21 17:25:58 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-05-21 17:33:36 +0200
commit6706659bb16677dfb6ad408bd24b93b6dc917717 (patch)
treedc82108f180dc06e0ab721aa28b23e41509c633c /qbs
parent17485ae7d0ca2c13a7078f094e3e51cb6d89aff6 (diff)
qbs build: Introduce item QtcProduct.
QtcAutotest, QtcLibrary, QtcPlugin and QtcTool share quite a bit of code, which is now factored out into this new item from which they all derive. Change-Id: Ic947a19e121f37d34968b29c94dd02648da1cd5b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'qbs')
-rw-r--r--qbs/imports/QtcAutotest.qbs24
-rw-r--r--qbs/imports/QtcLibrary.qbs22
-rw-r--r--qbs/imports/QtcPlugin.qbs24
-rw-r--r--qbs/imports/QtcProduct.qbs26
-rw-r--r--qbs/imports/QtcTool.qbs24
5 files changed, 53 insertions, 67 deletions
diff --git a/qbs/imports/QtcAutotest.qbs b/qbs/imports/QtcAutotest.qbs
index 6f07f61bb9..fb6ea09d7e 100644
--- a/qbs/imports/QtcAutotest.qbs
+++ b/qbs/imports/QtcAutotest.qbs
@@ -1,8 +1,8 @@
import qbs
import qbs.FileInfo
-import QtcFunctions
+import QtcProduct
-CppApplication {
+QtcProduct {
type: "application"
Depends { name: "Qt.test" }
targetName: "tst_" + name.split(' ').join("")
@@ -11,8 +11,6 @@ CppApplication {
destinationDirectory: buildDirectory + '/'
+ FileInfo.relativePath(project.ide_source_tree, sourceDirectory)
- cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs)
- cpp.linkerFlags: QtcFunctions.commonLinkerFlags(qbs)
cpp.rpaths: [
buildDirectory + '/' + project.ide_library_path,
buildDirectory + '/' + project.ide_library_path + "/..", // OSX
@@ -20,16 +18,16 @@ CppApplication {
]
cpp.minimumOsxVersion: "10.7"
+ Group {
+ fileTagsFilter: product.type
+ qbs.install: false
+ }
+
// 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"]
-// Group {
-// fileTagsFilter: product.type
-// qbs.install: true
-// qbs.installDir: project.ide_bin_path
-// }
+ // cpp.rpaths: qbs.targetOS.contains("osx")
+ // ? ["@executable_path/.."]
+ // : ["$ORIGIN/../" + project.libDirName + "/qtcreator",
+ // "$ORIGIN/../" project.libDirName + "/qtcreator/plugins"]
}
diff --git a/qbs/imports/QtcLibrary.qbs b/qbs/imports/QtcLibrary.qbs
index 55d5490384..75b395a1c2 100644
--- a/qbs/imports/QtcLibrary.qbs
+++ b/qbs/imports/QtcLibrary.qbs
@@ -1,8 +1,10 @@
import qbs 1.0
import QtcFunctions
+import QtcProduct
-DynamicLibrary {
- Depends { name: "cpp" }
+QtcProduct {
+ type: "dynamiclibrary"
+ installDir: project.ide_library_path
Depends {
condition: project.testsEnabled
name: "Qt.test"
@@ -11,13 +13,9 @@ DynamicLibrary {
targetName: QtcFunctions.qtLibraryName(qbs, name)
destinationDirectory: project.ide_library_path
- cpp.defines: project.generalDefines
- cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs)
cpp.linkerFlags: {
- var flags = QtcFunctions.commonLinkerFlags(qbs);
- if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
- flags.push("-Wl,-s");
- else if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc"))
+ var flags = base;
+ if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc"))
flags.push("/INCREMENTAL:NO"); // Speed up startup time when debugging with cdb
return flags;
}
@@ -27,17 +25,9 @@ DynamicLibrary {
: ["$ORIGIN", "$ORIGIN/.."]
property string libIncludeBase: ".." // #include <lib/header.h>
cpp.includePaths: [libIncludeBase]
- cpp.minimumOsxVersion: "10.7"
- cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
Export {
Depends { name: "cpp" }
cpp.includePaths: [libIncludeBase]
}
-
- Group {
- fileTagsFilter: product.type
- qbs.install: true
- qbs.installDir: project.ide_library_path
- }
}
diff --git a/qbs/imports/QtcPlugin.qbs b/qbs/imports/QtcPlugin.qbs
index 3d0d7471a4..14d8f909fe 100644
--- a/qbs/imports/QtcPlugin.qbs
+++ b/qbs/imports/QtcPlugin.qbs
@@ -1,13 +1,15 @@
import qbs 1.0
import qbs.FileInfo
import QtcFunctions
+import QtcProduct
-Product {
+QtcProduct {
type: ["dynamiclibrary", "pluginSpec"]
+ installDir: project.ide_plugin_path
+
property var pluginspecreplacements
property var pluginRecommends: []
- Depends { name: "Qt.core" }
property string minimumQtVersion: "4.8"
condition: QtcFunctions.versionIsAtLeast(Qt.core.version, minimumQtVersion)
@@ -16,30 +18,24 @@ Product {
Depends { name: "ExtensionSystem" }
Depends { name: "pluginspec" }
- Depends { name: "cpp" }
Depends {
condition: project.testsEnabled
name: "Qt.test"
}
- cpp.defines: project.generalDefines.concat([name.toUpperCase() + "_LIBRARY"])
+ cpp.defines: base.concat([name.toUpperCase() + "_LIBRARY"])
cpp.installNamePrefix: "@rpath/PlugIns/"
cpp.rpaths: qbs.targetOS.contains("osx") ? ["@loader_path/..", "@executable_path/.."]
: ["$ORIGIN", "$ORIGIN/.."]
- cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs)
cpp.linkerFlags: {
- var flags = QtcFunctions.commonLinkerFlags(qbs);
- if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
- flags.push("-Wl,-s");
- else if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc"))
+ var flags = base;
+ if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc"))
flags.push("/INCREMENTAL:NO"); // Speed up startup time when debugging with cdb
return flags;
}
property string pluginIncludeBase: ".." // #include <plugin/header.h>
cpp.includePaths: [pluginIncludeBase]
- cpp.minimumOsxVersion: "10.7"
- cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
Group {
name: "PluginSpec"
@@ -52,12 +48,6 @@ Product {
files: [ "*.mimetypes.xml" ]
}
- Group {
- fileTagsFilter: product.type
- qbs.install: true
- qbs.installDir: project.ide_plugin_path
- }
-
Export {
Depends { name: "ExtensionSystem" }
Depends { name: "cpp" }
diff --git a/qbs/imports/QtcProduct.qbs b/qbs/imports/QtcProduct.qbs
new file mode 100644
index 0000000000..a0433de4ef
--- /dev/null
+++ b/qbs/imports/QtcProduct.qbs
@@ -0,0 +1,26 @@
+import qbs 1.0
+import QtcFunctions
+
+Product {
+ property string installDir
+
+ Depends { name: "cpp" }
+ cpp.defines: project.generalDefines
+ cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs)
+ cpp.linkerFlags: {
+ var flags = QtcFunctions.commonLinkerFlags(qbs);
+ if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
+ flags.push("-Wl,-s");
+ return flags;
+ }
+ cpp.minimumOsxVersion: "10.7"
+ cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
+
+ Depends { name: "Qt.core" }
+
+ Group {
+ fileTagsFilter: product.type
+ qbs.install: true
+ qbs.installDir: installDir
+ }
+}
diff --git a/qbs/imports/QtcTool.qbs b/qbs/imports/QtcTool.qbs
index 34d5bf45a5..3581662f39 100644
--- a/qbs/imports/QtcTool.qbs
+++ b/qbs/imports/QtcTool.qbs
@@ -1,29 +1,11 @@
import qbs 1.0
-import QtcFunctions
+import QtcProduct
-Application {
+QtcProduct {
type: "application" // no Mac app bundle
- Depends { name: "cpp" }
- cpp.defines: project.generalDefines
- cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs)
- cpp.linkerFlags: {
- var flags = QtcFunctions.commonLinkerFlags(qbs);
- if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
- flags.push("-Wl,-s");
- return flags;
- }
-
- property string toolInstallDir: project.ide_libexec_path
+ installDir: project.ide_libexec_path
cpp.rpaths: qbs.targetOS.contains("osx")
? ["@executable_path/../" + project.ide_library_path]
: ["$ORIGIN/../" + project.ide_library_path]
- cpp.minimumOsxVersion: "10.7"
- cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
-
- Group {
- fileTagsFilter: product.type
- qbs.install: true
- qbs.installDir: toolInstallDir
- }
}