diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2014-12-21 01:33:58 -0800 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-01-13 12:17:01 +0100 |
commit | 55b81b5be50a36048b99af2ba78b6e2faf0d6ef9 (patch) | |
tree | 7c157e112be394ba79d6c4923b5fd084d90fa35e /share/qbs/modules/bundle/BundleModule.qbs | |
parent | 4d509be759a8c411f2c73e33cf6eef3e904f91fb (diff) |
Register applications with launch services after building.
Xcode does this now; so should we.
Change-Id: Ief06b468856d8653bba14f838683eb11e801f69f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'share/qbs/modules/bundle/BundleModule.qbs')
-rw-r--r-- | share/qbs/modules/bundle/BundleModule.qbs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs index 42bb661a7..9ab48d153 100644 --- a/share/qbs/modules/bundle/BundleModule.qbs +++ b/share/qbs/modules/bundle/BundleModule.qbs @@ -10,6 +10,14 @@ import qbs.TextFile Module { additionalProductTypes: ["bundle"] + setupBuildEnvironment: { + if (qbs.hostOS.contains("darwin")) { + var v = new ModUtils.EnvironmentVariable("PATH", ":", false); + v.prepend("/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support"); + v.set(); + } + } + property bool isBundle: qbs.targetOS.contains("darwin") && (product.type.contains("application") || product.type.contains("dynamiclibrary") @@ -457,6 +465,12 @@ Module { if (cmd.sources && cmd.sources.length) commands.push(cmd); + if (outputs.bundle && product.type.contains("application") && product.moduleProperty("qbs", "hostOS").contains("darwin")) { + cmd = new Command("lsregister", ["-f", outputs.bundle[0].filePath]); + cmd.description = "register " + ModUtils.moduleProperty(product, "bundleName"); + commands.push(cmd); + } + return commands; } } |