summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-28 14:39:12 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-02-28 14:39:12 (GMT)
commit0aec4d38642570cc38440b5368fec4de02e09a6a (patch)
tree39e31ac2a36deff08063de43b754db65b5db0931 /Source/cmGlobalXCodeGenerator.cxx
parent6403cda149e5213608b8f4889676c1e69aaf498a (diff)
parent7238a052b9238dc4405e90389a16a4dc61f848a6 (diff)
downloadCMake-0aec4d38642570cc38440b5368fec4de02e09a6a.zip
CMake-0aec4d38642570cc38440b5368fec4de02e09a6a.tar.gz
CMake-0aec4d38642570cc38440b5368fec4de02e09a6a.tar.bz2
Merge topic 'cmake-xcode-schemes'
7238a052 Xcode: Add documentation for schema generator ffb8817b Xcode: Write shared schemes based on the default files generated by Xcode
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 5167205..d1b6130 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -28,6 +28,7 @@
#include "cmTarget.h"
#include "cmXCode21Object.h"
#include "cmXCodeObject.h"
+#include "cmXCodeScheme.h"
#include "cm_auto_ptr.hxx"
#include "cmake.h"
@@ -3337,6 +3338,15 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
return;
}
this->WriteXCodePBXProj(fout, root, generators);
+
+ // Since the lowest available Xcode version for testing was 7.0,
+ // I'm setting this as a limit then
+ if (this->GetCMakeInstance()->GetState()->GetGlobalPropertyAsBool(
+ "XCODE_GENERATE_SCHEME") &&
+ this->XcodeVersion >= 70) {
+ this->OutputXCodeSharedSchemes(xcodeDir, root);
+ }
+
this->ClearXCodeObjects();
// Since this call may have created new cache entries, save the cache:
@@ -3345,6 +3355,24 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
root->GetBinaryDirectory());
}
+void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes(
+ const std::string& xcProjDir, cmLocalGenerator* root)
+{
+ for (std::vector<cmXCodeObject*>::const_iterator i =
+ this->XCodeObjects.begin();
+ i != this->XCodeObjects.end(); ++i) {
+ cmXCodeObject* obj = *i;
+ if (obj->GetType() == cmXCodeObject::OBJECT &&
+ (obj->GetIsA() == cmXCodeObject::PBXNativeTarget ||
+ obj->GetIsA() == cmXCodeObject::PBXAggregateTarget)) {
+ cmXCodeScheme schm(obj, this->CurrentConfigurationTypes,
+ this->XcodeVersion);
+ schm.WriteXCodeSharedScheme(xcProjDir,
+ root->GetCurrentSourceDirectory());
+ }
+ }
+}
+
void cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
cmLocalGenerator*,
std::vector<cmLocalGenerator*>&)