MCPcopy Create free account
hub / github.com/Kitware/CMake / CreateFramework

Method CreateFramework

Source/cmOSXBundleGenerator.cxx:59–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void cmOSXBundleGenerator::CreateFramework(
60 std::string const& targetName, std::string const& outpath,
61 std::string const& config, cmOSXBundleGenerator::SkipParts skipParts)
62{
63 if (this->MustSkip()) {
64 return;
65 }
66
67 assert(this->MacContentFolders);
68
69 // Compute the location of the top-level foo.framework directory.
70 std::string contentdir = cmStrCat(
71 outpath, '/',
72 this->GT->GetFrameworkDirectory(config, cmGeneratorTarget::ContentLevel),
73 '/');
74
75 std::string newoutpath = outpath + "/" +
76 this->GT->GetFrameworkDirectory(config, cmGeneratorTarget::FullLevel);
77
78 std::string frameworkVersion = this->GT->GetFrameworkVersion();
79
80 std::string name = cmSystemTools::GetFilenameName(targetName);
81 if (!skipParts.InfoPlist) {
82 // Configure the Info.plist file
83 std::string plist = newoutpath;
84 if (!this->Makefile->PlatformIsAppleEmbedded()) {
85 // Put the Info.plist file into the Resources directory.
86 this->MacContentFolders->insert("Resources");
87 plist += "/Resources";
88 }
89 plist += "/Info.plist";
90 this->LocalGenerator->GenerateFrameworkInfoPList(this->GT, name, plist);
91 }
92
93 // Generate Versions directory only for MacOSX frameworks
94 if (this->Makefile->PlatformIsAppleEmbedded()) {
95 return;
96 }
97
98 // TODO: Use the cmMakefileTargetGenerator::ExtraFiles vector to
99 // drive rules to create these files at build time.
100 std::string oldName;
101 std::string newName;
102
103 // Make foo.framework/Versions
104 std::string versions = cmStrCat(contentdir, "Versions");
105 cmSystemTools::MakeDirectory(versions);
106
107 // Make foo.framework/Versions/version
108 cmSystemTools::MakeDirectory(newoutpath);
109
110 // Current -> version
111 oldName = frameworkVersion;
112 newName = cmStrCat(versions, "/Current");
113 cmSystemTools::RemoveFile(newName);
114 cmSystemTools::CreateSymlink(oldName, newName);
115 this->Makefile->AddCMakeOutputFile(newName);
116

Callers 3

WriteLibraryRulesMethod · 0.80
GenerateLinkMethod · 0.80
WriteLinkStatementMethod · 0.80

Calls 11

MustSkipMethod · 0.95
GetFrameworkDirectoryMethod · 0.80
GetFrameworkVersionMethod · 0.80
AddCMakeOutputFileMethod · 0.80
cmStrCatFunction · 0.70
insertMethod · 0.45
GetDefinitionMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected