MCPcopy Index your code
hub / github.com/Kitware/CMake / OutputXCodeSharedSchemes

Method OutputXCodeSharedSchemes

Source/cmGlobalXCodeGenerator.cxx:5171–5219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5169}
5170
5171bool cmGlobalXCodeGenerator::OutputXCodeSharedSchemes(
5172 std::string const& xcProjDir, cmLocalGenerator* root)
5173{
5174 // collect all tests for the targets
5175 std::map<std::string, cmXCodeScheme::TestObjects> testables;
5176
5177 for (auto const& obj : this->XCodeObjects) {
5178 if (obj->GetType() != cmXCodeObject::OBJECT ||
5179 obj->GetIsA() != cmXCodeObject::PBXNativeTarget) {
5180 continue;
5181 }
5182
5183 if (!obj->GetTarget()->IsXCTestOnApple()) {
5184 continue;
5185 }
5186
5187 cmValue testee = obj->GetTarget()->GetProperty("XCTEST_TESTEE");
5188 if (!testee) {
5189 continue;
5190 }
5191
5192 testables[*testee].push_back(obj.get());
5193 }
5194
5195 // generate scheme
5196 bool ret = false;
5197
5198 // Since the lowest available Xcode version for testing was 6.4,
5199 // I'm setting this as a limit then
5200 if (this->XcodeVersion >= 64) {
5201 for (auto const& obj : this->XCodeObjects) {
5202 if (obj->GetType() == cmXCodeObject::OBJECT &&
5203 (obj->GetIsA() == cmXCodeObject::PBXNativeTarget ||
5204 obj->GetIsA() == cmXCodeObject::PBXAggregateTarget) &&
5205 (root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() ||
5206 obj->GetTarget()->GetPropertyAsBool("XCODE_GENERATE_SCHEME"))) {
5207 std::string const& targetName = obj->GetTarget()->GetName();
5208 cmXCodeScheme schm(root, obj.get(), testables[targetName],
5209 this->CurrentConfigurationTypes,
5210 this->XcodeVersion);
5211 schm.WriteXCodeSharedScheme(xcProjDir,
5212 this->RelativeToSource(xcProjDir));
5213 ret = true;
5214 }
5215 }
5216 }
5217
5218 return ret;
5219}
5220
5221void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings(
5222 std::string const& xcProjDir, bool hasGeneratedSchemes)

Callers 1

OutputXCodeProjectMethod · 0.95

Calls 14

RelativeToSourceMethod · 0.95
GetIsAMethod · 0.80
IsXCTestOnAppleMethod · 0.80
push_backMethod · 0.80
GetIsInTryCompileMethod · 0.80
GetTypeMethod · 0.45
GetTargetMethod · 0.45
GetPropertyMethod · 0.45
getMethod · 0.45
GetCMakeInstanceMethod · 0.45
GetMakefileMethod · 0.45

Tested by

no test coverage detected