| 5169 | } |
| 5170 | |
| 5171 | bool 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 | |
| 5221 | void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings( |
| 5222 | std::string const& xcProjDir, bool hasGeneratedSchemes) |
no test coverage detected