mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Xcode: Add support for combined install on iOS
This patch solves the problem of installing both: Device and Simulator libraries on iOS. Before only one of them was installed. If the IOS_INSTALL_COMBINED property is set on a target, a special install hook will be activated which builds the corresponding target and combines both at the install location. The original patch was contributed by Ruslan Baratov, and polished by Gregor Jasny.
This commit is contained in:
committed by
Gregor Jasny
parent
34f5ef564a
commit
565d080a9a
@@ -531,6 +531,7 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
|
||||
{
|
||||
this->AddInstallNamePatchRule(os, indent, config, file);
|
||||
this->AddChrpathPatchRule(os, indent, config, file);
|
||||
this->AddUniversalInstallRule(os, indent, file);
|
||||
this->AddRanlibRule(os, indent, file);
|
||||
this->AddStripRule(os, indent, file);
|
||||
}
|
||||
@@ -867,3 +868,46 @@ cmInstallTargetGenerator::AddRanlibRule(std::ostream& os,
|
||||
os << indent << "execute_process(COMMAND \""
|
||||
<< ranlib << "\" \"" << toDestDirPath << "\")\n";
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
cmInstallTargetGenerator
|
||||
::AddUniversalInstallRule(std::ostream& os,
|
||||
Indent const& indent,
|
||||
const std::string& toDestDirPath)
|
||||
{
|
||||
cmMakefile const* mf = this->Target->Target->GetMakefile();
|
||||
|
||||
if(!mf->PlatformIsAppleIos() || !mf->IsOn("XCODE"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const char* xcodeVersion = mf->GetDefinition("XCODE_VERSION");
|
||||
if(!xcodeVersion || cmSystemTools::VersionCompareGreater("6", xcodeVersion))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch(this->Target->GetType())
|
||||
{
|
||||
case cmState::EXECUTABLE:
|
||||
case cmState::STATIC_LIBRARY:
|
||||
case cmState::SHARED_LIBRARY:
|
||||
case cmState::MODULE_LIBRARY:
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if(!this->Target->Target->GetPropertyAsBool("IOS_INSTALL_COMBINED"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
os << indent << "include(CMakeIOSInstallCombined)\n";
|
||||
os << indent << "ios_install_combined("
|
||||
<< "\"" << this->Target->Target->GetName() << "\" "
|
||||
<< "\"" << toDestDirPath << "\")\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user