summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-02-09 13:23:24 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-02-09 13:23:29 (GMT)
commit263fd22fd83967d298cda61cedf9f34ad3bf1862 (patch)
tree693ec8bf2f5747eef50731f2dbd5a9f3bbc8150f /Source
parent58167b3eb07408bd04f3b00fd1b3530817c3b7d8 (diff)
parent0110aa018d81a7b0f1f9371fcd038b71fefae554 (diff)
downloadCMake-263fd22fd83967d298cda61cedf9f34ad3bf1862.zip
CMake-263fd22fd83967d298cda61cedf9f34ad3bf1862.tar.gz
CMake-263fd22fd83967d298cda61cedf9f34ad3bf1862.tar.bz2
Merge topic 'xcode12-ios_install_combined' into release-3.19
0110aa018d IOS_INSTALL_COMBINED: Support Xcode 12 (command line only) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5785
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmLocalXCodeGenerator.cxx60
-rw-r--r--Source/cmLocalXCodeGenerator.h2
4 files changed, 62 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2239192..b5580e7 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -644,6 +644,8 @@ void cmLocalGenerator::GenerateInstallRules()
/* clang-format on */
}
+ this->AddGeneratorSpecificInstallSetup(fout);
+
// Ask each install generator to write its code.
cmPolicies::PolicyStatus status = this->GetPolicyStatus(cmPolicies::CMP0082);
auto const& installers = this->Makefile->GetInstallGenerators();
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 22d3599..0fa8759 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -493,6 +493,8 @@ protected:
std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes);
+ virtual void AddGeneratorSpecificInstallSetup(std::ostream&) {}
+
std::string& CreateSafeUniqueObjectFileName(const std::string& sin,
std::string const& dir_max);
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index ac0d35e..3b4e3a8 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -4,6 +4,7 @@
#include "cmGeneratorTarget.h"
#include "cmGlobalXCodeGenerator.h"
+#include "cmMakefile.h"
#include "cmSourceFile.h"
class cmGeneratorTarget;
@@ -45,13 +46,66 @@ void cmLocalXCodeGenerator::Generate()
}
}
-void cmLocalXCodeGenerator::GenerateInstallRules()
+void cmLocalXCodeGenerator::AddGeneratorSpecificInstallSetup(std::ostream& os)
{
- cmLocalGenerator::GenerateInstallRules();
-
+ // First check if we need to warn about incompatible settings
for (const auto& target : this->GetGeneratorTargets()) {
target->HasMacOSXRpathInstallNameDir("");
}
+
+ // CMakeIOSInstallCombined.cmake needs to know the location of the top of
+ // the build directory
+ os << "set(CMAKE_BINARY_DIR \"" << this->GetBinaryDirectory() << "\")\n\n";
+
+ if (this->Makefile->PlatformIsAppleEmbedded()) {
+ std::string platformName;
+ switch (this->Makefile->GetAppleSDKType()) {
+ case cmMakefile::AppleSDK::IPhoneOS:
+ platformName = "iphoneos";
+ break;
+ case cmMakefile::AppleSDK::IPhoneSimulator:
+ platformName = "iphonesimulator";
+ break;
+ case cmMakefile::AppleSDK::AppleTVOS:
+ platformName = "appletvos";
+ break;
+ case cmMakefile::AppleSDK::AppleTVSimulator:
+ platformName = "appletvsimulator";
+ break;
+ case cmMakefile::AppleSDK::WatchOS:
+ platformName = "watchos";
+ break;
+ case cmMakefile::AppleSDK::WatchSimulator:
+ platformName = "watchsimulator";
+ break;
+ case cmMakefile::AppleSDK::MacOS:
+ break;
+ }
+ if (!platformName.empty()) {
+ // The effective platform name is just the platform name with a hyphen
+ // prepended. We can get the SUPPORTED_PLATFORMS from the project file
+ // at runtime, so we don't need to compute that here.
+ /* clang-format off */
+ os <<
+ "if(NOT PLATFORM_NAME)\n"
+ " if(NOT \"$ENV{PLATFORM_NAME}\" STREQUAL \"\")\n"
+ " set(PLATFORM_NAME \"$ENV{PLATFORM_NAME}\")\n"
+ " endif()\n"
+ " if(NOT PLATFORM_NAME)\n"
+ " set(PLATFORM_NAME " << platformName << ")\n"
+ " endif()\n"
+ "endif()\n\n"
+ "if(NOT EFFECTIVE_PLATFORM_NAME)\n"
+ " if(NOT \"$ENV{EFFECTIVE_PLATFORM_NAME}\" STREQUAL \"\")\n"
+ " set(EFFECTIVE_PLATFORM_NAME \"$ENV{EFFECTIVE_PLATFORM_NAME}\")\n"
+ " endif()\n"
+ " if(NOT EFFECTIVE_PLATFORM_NAME)\n"
+ " set(EFFECTIVE_PLATFORM_NAME -" << platformName << ")\n"
+ " endif()\n"
+ "endif()\n\n";
+ /* clang-format off */
+ }
+ }
}
void cmLocalXCodeGenerator::ComputeObjectFilenames(
diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h
index dd038b4..5f72f6d 100644
--- a/Source/cmLocalXCodeGenerator.h
+++ b/Source/cmLocalXCodeGenerator.h
@@ -32,7 +32,7 @@ public:
void AppendFlagEscape(std::string& flags,
const std::string& rawFlag) const override;
void Generate() override;
- virtual void GenerateInstallRules();
+ void AddGeneratorSpecificInstallSetup(std::ostream& os) override;
void ComputeObjectFilenames(
std::map<cmSourceFile const*, std::string>& mapping,
cmGeneratorTarget const* gt = nullptr) override;