| 240 | } |
| 241 | |
| 242 | void cmExtraCodeLiteGenerator::CreateNewProjectFile( |
| 243 | std::vector<cmLocalGenerator*> const& lgs, std::string const& filename) |
| 244 | { |
| 245 | cmMakefile const* mf = lgs[0]->GetMakefile(); |
| 246 | cmGeneratedFileStream fout(filename); |
| 247 | if (!fout) { |
| 248 | return; |
| 249 | } |
| 250 | cmXMLWriter xml(fout); |
| 251 | |
| 252 | //////////////////////////////////// |
| 253 | xml.StartDocument("utf-8"); |
| 254 | xml.StartElement("CodeLite_Project"); |
| 255 | xml.Attribute("Name", lgs[0]->GetProjectName()); |
| 256 | xml.Attribute("InternalType", ""); |
| 257 | |
| 258 | std::string projectType; |
| 259 | |
| 260 | // Collect all used source files in the project |
| 261 | // Sort them into two containers, one for C/C++ implementation files |
| 262 | // which may have an accompanying header, one for all other files |
| 263 | std::map<std::string, cmSourceFile*> cFiles; |
| 264 | std::set<std::string> otherFiles; |
| 265 | |
| 266 | for (cmLocalGenerator* lg : lgs) { |
| 267 | cmMakefile* makefile = lg->GetMakefile(); |
| 268 | for (auto const& target : lg->GetGeneratorTargets()) { |
| 269 | projectType = |
| 270 | this->CollectSourceFiles(makefile, target.get(), cFiles, otherFiles); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | // Get the project path ( we need it later to convert files to |
| 275 | // their relative path) |
| 276 | std::string projectPath = cmSystemTools::GetFilenamePath(filename); |
| 277 | |
| 278 | this->CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf, |
| 279 | projectType, ""); |
| 280 | |
| 281 | xml.EndElement(); // CodeLite_Project |
| 282 | } |
| 283 | |
| 284 | void cmExtraCodeLiteGenerator::FindMatchingHeaderfiles( |
| 285 | std::map<std::string, cmSourceFile*>& cFiles, |
no test coverage detected