aboutsummaryrefslogtreecommitdiffstats
path: root/examples/install-bundle/install-bundle.qbs
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2015-05-01 19:52:58 -0700
committerJake Petroules <jake.petroules@petroules.com>2015-05-04 09:17:38 +0000
commit805c6b95db2e6d1f754797a14fce6d5254b3e2f2 (patch)
tree59cb4142cb5cb7e0fe85b8b2d31b3ad1d10c343c /examples/install-bundle/install-bundle.qbs
parenta4f4a305ae49914b7a6a8d83b8ae79e1c98723f1 (diff)
Add an example demonstrating how to properly install bundle products.
Change-Id: Iee310389b2c64f5c2b1df1ad59f3260a2fa294f6 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'examples/install-bundle/install-bundle.qbs')
-rw-r--r--examples/install-bundle/install-bundle.qbs57
1 files changed, 57 insertions, 0 deletions
diff --git a/examples/install-bundle/install-bundle.qbs b/examples/install-bundle/install-bundle.qbs
new file mode 100644
index 000000000..660b77a66
--- /dev/null
+++ b/examples/install-bundle/install-bundle.qbs
@@ -0,0 +1,57 @@
+import qbs
+import qbs.FileInfo
+
+Project {
+ CppApplication {
+ Depends { name: "coreutils" }
+ Depends { name: "Qt"; submodules: ["core", "gui", "widgets"] }
+
+ name: "window"
+ targetName: bundle.isBundle ? "Window" : "window"
+ files: ["main.cpp"]
+
+ property bool install: true
+ property string installDir: bundle.isBundle ? "Applications" : "bin"
+
+ Group {
+ fileTagsFilter: ["application"]
+ qbs.install: install
+ qbs.installDir: bundle.isBundle ? FileInfo.joinPaths(installDir, FileInfo.path(bundle.executablePath)) : installDir
+ }
+
+ Group {
+ fileTagsFilter: ["infoplist"]
+ qbs.install: install && bundle.isBundle && !bundle.embedInfoPlist
+ qbs.installDir: FileInfo.joinPaths(installDir, FileInfo.path(bundle.infoPlistPath))
+ }
+
+ Group {
+ fileTagsFilter: ["pkginfo"]
+ qbs.install: install && bundle.isBundle
+ qbs.installDir: FileInfo.joinPaths(installDir, FileInfo.path(bundle.pkgInfoPath))
+ }
+ }
+
+ DynamicLibrary {
+ Depends { name: "cpp" }
+
+ name: "coreutils"
+ targetName: bundle.isBundle ? "CoreUtils" : "coreutils"
+ files: ["coreutils.cpp"]
+
+ property bool install: true
+ property string installDir: bundle.isBundle ? "Library/Frameworks" : "lib"
+
+ Group {
+ fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_symlink"]
+ qbs.install: install
+ qbs.installDir: bundle.isBundle ? FileInfo.joinPaths(installDir, FileInfo.path(bundle.executablePath)) : installDir
+ }
+
+ Group {
+ fileTagsFilter: ["infoplist"]
+ qbs.install: install && bundle.isBundle && !bundle.embedInfoPlist
+ qbs.installDir: FileInfo.joinPaths(installDir, FileInfo.path(bundle.infoPlistPath))
+ }
+ }
+}