summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2015-10-08 00:09:34 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2015-12-10 21:36:12 (GMT)
commit565d080a9a1e133bda868e905226181b60e90356 (patch)
tree053f5bc1c985e5431d19a8cee5c4a5c71b071c5b /Source
parent34f5ef564aa94f2f66f35c708dbfca260b419e4b (diff)
downloadCMake-565d080a9a1e133bda868e905226181b60e90356.zip
CMake-565d080a9a1e133bda868e905226181b60e90356.tar.gz
CMake-565d080a9a1e133bda868e905226181b60e90356.tar.bz2
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.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmInstallTargetGenerator.cxx44
-rw-r--r--Source/cmInstallTargetGenerator.h2
-rw-r--r--Source/cmTarget.cxx1
3 files changed, 47 insertions, 0 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index c6908c3..1158a27 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -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";
+}
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index ec89c05..18b3130 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -101,6 +101,8 @@ protected:
const std::string& toDestDirPath);
void AddRanlibRule(std::ostream& os, Indent const& indent,
const std::string& toDestDirPath);
+ void AddUniversalInstallRule(std::ostream& os, Indent const& indent,
+ const std::string& toDestDirPath);
std::string TargetName;
cmGeneratorTarget* Target;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9ea1a34..1986e5f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -132,6 +132,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
this->SetPropertyDefault("GNUtoMS", 0);
this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
+ this->SetPropertyDefault("IOS_INSTALL_COMBINED", 0);
this->SetPropertyDefault("AUTOMOC", 0);
this->SetPropertyDefault("AUTOUIC", 0);
this->SetPropertyDefault("AUTORCC", 0);