| 57 | } |
| 58 | |
| 59 | void 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 |
no test coverage detected