diff options
| author | Brad King <brad.king@kitware.com> | 2021-04-05 17:45:08 (GMT) |
|---|---|---|
| committer | Brad King <brad.king@kitware.com> | 2021-04-05 17:45:08 (GMT) |
| commit | f9f59fb0b201987c218579e1310cc62a05df5694 (patch) | |
| tree | 95da5b35a4d16a2b25639fa9ceedd717f0f2d7ff /Source/cmLocalXCodeGenerator.cxx | |
| parent | 30959aec8f1347ac2098f85824fe6777dae627b5 (diff) | |
| parent | 0913499f69463c94cc16ed437721e88148e131a8 (diff) | |
| download | CMake-f9f59fb0b201987c218579e1310cc62a05df5694.zip CMake-f9f59fb0b201987c218579e1310cc62a05df5694.tar.gz CMake-f9f59fb0b201987c218579e1310cc62a05df5694.tar.bz2 | |
Merge branch 'release-3.19' into backport-3.19-rel-file-table
Diffstat (limited to 'Source/cmLocalXCodeGenerator.cxx')
| -rw-r--r-- | Source/cmLocalXCodeGenerator.cxx | 60 |
1 files changed, 57 insertions, 3 deletions
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( |
