summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2017-02-24 15:19:14 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2017-02-28 21:38:29 (GMT)
commit5995082101a1959f303f9f3d6c0a1e483630749e (patch)
treeeab5c52e0976918ac8ad9d641d75b53c42c19060 /Source
parent6a54d28e44c3e539a0f6b45a5bdd748df5ef29ca (diff)
downloadCMake-5995082101a1959f303f9f3d6c0a1e483630749e.zip
CMake-5995082101a1959f303f9f3d6c0a1e483630749e.tar.gz
CMake-5995082101a1959f303f9f3d6c0a1e483630749e.tar.bz2
Xcode: Do not autocreate schemes
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx31
-rw-r--r--Source/cmGlobalXCodeGenerator.h1
2 files changed, 32 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index d1b6130..f0ebf88 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3345,6 +3345,7 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
"XCODE_GENERATE_SCHEME") &&
this->XcodeVersion >= 70) {
this->OutputXCodeSharedSchemes(xcodeDir, root);
+ this->OutputXCodeWorkspaceSettings(xcodeDir);
}
this->ClearXCodeObjects();
@@ -3373,6 +3374,36 @@ void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes(
}
}
+void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings(
+ const std::string& xcProjDir)
+{
+ std::string xcodeSharedDataDir = xcProjDir;
+ xcodeSharedDataDir += "/project.xcworkspace/xcshareddata";
+ cmSystemTools::MakeDirectory(xcodeSharedDataDir);
+
+ std::string workspaceSettingsFile = xcodeSharedDataDir;
+ workspaceSettingsFile += "/WorkspaceSettings.xcsettings";
+
+ cmGeneratedFileStream fout(workspaceSettingsFile.c_str());
+ fout.SetCopyIfDifferent(true);
+ if (!fout) {
+ return;
+ }
+
+ cmXMLWriter xout(fout);
+ xout.StartDocument();
+ xout.Doctype("plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\""
+ "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"");
+ xout.StartElement("plist");
+ xout.Attribute("version", "1.0");
+ xout.StartElement("dict");
+ xout.Element("key", "IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded");
+ xout.Element("false");
+ xout.EndElement(); // dict
+ xout.EndElement(); // plist
+ xout.EndDocument();
+}
+
void cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
cmLocalGenerator*,
std::vector<cmLocalGenerator*>&)
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index c9157b0..dcbc77a 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -168,6 +168,7 @@ private:
// Write shared scheme files for all the native targets
void OutputXCodeSharedSchemes(const std::string& xcProjDir,
cmLocalGenerator* root);
+ void OutputXCodeWorkspaceSettings(const std::string& xcProjDir);
void WriteXCodePBXProj(std::ostream& fout, cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
cmXCodeObject* CreateXCodeFileReferenceFromPath(const std::string& fullpath,