aboutsummaryrefslogtreecommitdiffstats
path: root/qbs-resources
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-05-19 17:07:49 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2016-06-07 12:31:21 +0000
commitddc360f424720799c26ce47d49f13929e00af2df (patch)
tree3713414489cb0871b84fc2dcc98036db5a35d408 /qbs-resources
parent81e2141158af5ad4f457a2671dd2717d8302e90e (diff)
qbs build: Move build config properties into a dedicated module.
Qt Creator will do the same in order to be able to build plugins that are not part of the main source tree. This means the qbs build and install settings can no longer be controlled by properties in a higher- level project file, but need to come from a module. Change-Id: I20c0a4538395c8ee838b33f35be84ee59f601f90 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qbs-resources')
-rw-r--r--qbs-resources/imports/QbsApp.qbs2
-rw-r--r--qbs-resources/imports/QbsAutotest.qbs1
-rw-r--r--qbs-resources/imports/QbsLibrary.qbs8
-rw-r--r--qbs-resources/imports/QbsProduct.qbs1
-rw-r--r--qbs-resources/modules/qbsbuildconfig/qbsbuildconfig.qbs25
5 files changed, 33 insertions, 4 deletions
diff --git a/qbs-resources/imports/QbsApp.qbs b/qbs-resources/imports/QbsApp.qbs
index 530e9fddb..a6a53048e 100644
--- a/qbs-resources/imports/QbsApp.qbs
+++ b/qbs-resources/imports/QbsApp.qbs
@@ -13,7 +13,7 @@ QbsProduct {
Group {
fileTagsFilter: product.type
qbs.install: true
- qbs.installDir: project.appInstallDir
+ qbs.installDir: qbsbuildconfig.appInstallDir
}
Group {
name: "logging"
diff --git a/qbs-resources/imports/QbsAutotest.qbs b/qbs-resources/imports/QbsAutotest.qbs
index 43db835a9..6e955971c 100644
--- a/qbs-resources/imports/QbsAutotest.qbs
+++ b/qbs-resources/imports/QbsAutotest.qbs
@@ -7,6 +7,7 @@ QtApplication {
name: "tst_" + testName
Depends { name: "Qt.test" }
Depends { name: "qbscore" }
+ Depends { name: "qbsbuildconfig" }
cpp.includePaths: "../../../src"
cpp.cxxLanguageVersion: "c++11"
destinationDirectory: "bin"
diff --git a/qbs-resources/imports/QbsLibrary.qbs b/qbs-resources/imports/QbsLibrary.qbs
index 474b67343..2d3e10fb1 100644
--- a/qbs-resources/imports/QbsLibrary.qbs
+++ b/qbs-resources/imports/QbsLibrary.qbs
@@ -7,7 +7,7 @@ QbsProduct {
version: QbsFunctions.qbsVersion()
type: Qt.core.staticBuild ? "staticlibrary" : "dynamiclibrary"
targetName: (qbs.enableDebugCode && qbs.targetOS.contains("windows")) ? (name + 'd') : name
- destinationDirectory: qbs.targetOS.contains("windows") ? "bin" : project.libDirName
+ destinationDirectory: qbs.targetOS.contains("windows") ? "bin" : qbsbuildconfig.libDirName
cpp.defines: base.concat(type == "staticlibrary" ? ["QBS_STATIC_LIB"] : ["QBS_LIBRARY"])
cpp.sonamePrefix: qbs.targetOS.contains("darwin") ? "@rpath" : undefined
cpp.visibility: "minimal"
@@ -17,12 +17,14 @@ QbsProduct {
Group {
fileTagsFilter: product.type.concat("dynamiclibrary_symlink")
qbs.install: true
- qbs.installDir: project.libInstallDir
+ qbs.installDir: qbsbuildconfig.libInstallDir
}
Export {
Depends { name: "cpp" }
Depends { name: "Qt"; submodules: ["core"] }
- cpp.rpaths: project.libRPaths
+ Depends { name: "qbsbuildconfig" }
+
+ cpp.rpaths: qbsbuildconfig.libRPaths
cpp.includePaths: [product.sourceDirectory]
cpp.defines: product.type === "staticlibrary" ? ["QBS_STATIC_LIB"] : []
}
diff --git a/qbs-resources/imports/QbsProduct.qbs b/qbs-resources/imports/QbsProduct.qbs
index 0bd43bf08..305e4c755 100644
--- a/qbs-resources/imports/QbsProduct.qbs
+++ b/qbs-resources/imports/QbsProduct.qbs
@@ -2,6 +2,7 @@ import qbs
import QbsFunctions
Product {
+ Depends { name: "qbsbuildconfig" }
Depends { name: "Qt.core" }
property string minimumQtVersion: "5.4.0"
cpp.defines: {
diff --git a/qbs-resources/modules/qbsbuildconfig/qbsbuildconfig.qbs b/qbs-resources/modules/qbsbuildconfig/qbsbuildconfig.qbs
new file mode 100644
index 000000000..0ceca7dd4
--- /dev/null
+++ b/qbs-resources/modules/qbsbuildconfig/qbsbuildconfig.qbs
@@ -0,0 +1,25 @@
+import qbs
+
+Module {
+ property bool enableUnitTests: false
+ property bool enableProjectFileUpdates: false
+ property bool enableRPath: true
+ property bool installApiHeaders: true
+ property string libDirName: "lib"
+ property string appInstallDir: "bin"
+ property string libInstallDir: qbs.targetOS.contains("windows") ? "bin" : libDirName
+ property string libexecInstallDir: "libexec/qbs"
+ property string relativeLibexecPath: "../" + libexecInstallDir
+ property string relativePluginsPath: "../" + libDirName
+ property string relativeSearchPath: ".."
+ property stringList libRPaths: {
+ if (!enableRPath)
+ return undefined;
+ if (qbs.targetOS.contains("linux"))
+ return ["$ORIGIN/../" + libDirName];
+ if (qbs.targetOS.contains("osx"))
+ return ["@loader_path/../" + libDirName]
+ }
+ property string resourcesInstallDir: ""
+ property string pluginsInstallDir: libDirName
+}