diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 31 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.h | 1 |
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, |