From 134d5c1f7c82698b79d88ba92a7bd98b81dceaec Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Sun, 19 Jun 2016 21:26:40 +0200 Subject: [PATCH] Honor BUNDLE_EXTENSION also for Frameworks (#14742) --- Source/cmGeneratorTarget.cxx | 15 +++++++++++++-- Source/cmGlobalXCodeGenerator.cxx | 5 +++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index f45d4f0d2..793ad2ec1 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1400,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(); @@ -3016,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 52f8da5c8..b396ea1e6 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,