summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-01 18:59:44 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-01 18:59:44 (GMT)
commit2711c35a8d42e43c7600ef23bf586f2e068292e8 (patch)
treedc46e76d164b085495bebe7718eb16b000b7ea6b /Source
parent8427b8e11c9a98fb7f7875a1153ab4998e61d4c1 (diff)
parentf951d0adb4f7ca185804fba530a3dbc9b81f1cc5 (diff)
downloadCMake-2711c35a8d42e43c7600ef23bf586f2e068292e8.zip
CMake-2711c35a8d42e43c7600ef23bf586f2e068292e8.tar.gz
CMake-2711c35a8d42e43c7600ef23bf586f2e068292e8.tar.bz2
Merge topic 'app-framework-bundle-extension'
f951d0ad Add tests for BUNDLE_EXTENSION c63380b1 Update documentation about bundle extensions 134d5c1f Honor BUNDLE_EXTENSION also for Frameworks (#14742) 2b909c08 Honor BUNDLE_EXTENSION also for App Bundles (#16148)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx22
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx10
-rw-r--r--Source/cmInstallTargetGenerator.cxx13
3 files changed, 40 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c9cbd00..793ad2e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1350,7 +1350,12 @@ std::string cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
bool contentOnly) const
{
std::string fpath = this->GetFullName(config, false);
- fpath += ".app";
+ fpath += ".";
+ const char* ext = this->GetProperty("BUNDLE_EXTENSION");
+ if (!ext) {
+ ext = "app";
+ }
+ fpath += ext;
if (!this->Makefile->PlatformIsAppleIos()) {
fpath += "/Contents";
if (!contentOnly) {
@@ -1395,7 +1400,12 @@ std::string cmGeneratorTarget::GetFrameworkDirectory(const std::string& config,
{
std::string fpath;
fpath += this->GetOutputName(config, false);
- fpath += ".framework";
+ fpath += ".";
+ const char* ext = this->GetProperty("BUNDLE_EXTENSION");
+ if (!ext) {
+ ext = "framework";
+ }
+ fpath += ext;
if (!rootDir && !this->Makefile->PlatformIsAppleIos()) {
fpath += "/Versions/";
fpath += this->GetFrameworkVersion();
@@ -3011,7 +3021,13 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
std::string fw_prefix;
if (this->IsFrameworkOnApple()) {
fw_prefix = this->GetOutputName(config, false);
- fw_prefix += ".framework/";
+ fw_prefix += ".";
+ const char* ext = this->GetProperty("BUNDLE_EXTENSION");
+ if (!ext) {
+ ext = "framework";
+ }
+ fw_prefix += ext;
+ fw_prefix += "/";
targetPrefix = fw_prefix.c_str();
targetSuffix = CM_NULLPTR;
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 23fad51..b396ea1 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1844,6 +1844,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
std::string fw_version = gtgt->GetFrameworkVersion();
buildSettings->AddAttribute("FRAMEWORK_VERSION",
this->CreateString(fw_version));
+ const char* ext = gtgt->GetProperty("BUNDLE_EXTENSION");
+ if (ext) {
+ buildSettings->AddAttribute("WRAPPER_EXTENSION",
+ this->CreateString(ext));
+ }
std::string plist = this->ComputeInfoPListLocation(gtgt);
// Xcode will create the final version of Info.plist at build time,
@@ -1878,6 +1883,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
// Handle bundles and normal executables separately.
if (gtgt->GetPropertyAsBool("MACOSX_BUNDLE")) {
+ const char* ext = gtgt->GetProperty("BUNDLE_EXTENSION");
+ if (ext) {
+ buildSettings->AddAttribute("WRAPPER_EXTENSION",
+ this->CreateString(ext));
+ }
std::string plist = this->ComputeInfoPListLocation(gtgt);
// Xcode will create the final version of Info.plist at build time,
// so let it replace the executable name. This avoids creating
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 448d278..4b2f40c 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -142,13 +142,22 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
if (this->Target->IsAppBundleOnApple()) {
cmMakefile const* mf = this->Target->Target->GetMakefile();
+ // Get App Bundle Extension
+ const char* ext = this->Target->GetProperty("BUNDLE_EXTENSION");
+ if (!ext) {
+ ext = "app";
+ }
+
// Install the whole app bundle directory.
type = cmInstallType_DIRECTORY;
literal_args += " USE_SOURCE_PERMISSIONS";
- from1 += ".app";
+ from1 += ".";
+ from1 += ext;
// Tweaks apply to the binary inside the bundle.
- to1 += ".app/";
+ to1 += ".";
+ to1 += ext;
+ to1 += "/";
if (!mf->PlatformIsAppleIos()) {
to1 += "Contents/MacOS/";
}