1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 file Copyright.txt or https://cmake.org/licensing for details. */ 3 #pragma once 4 5 #include "cmConfigure.h" // IWYU pragma: keep 6 7 #include <map> 8 #include <set> 9 #include <string> 10 #include <vector> 11 12 #include "cmExternalMakefileProjectGenerator.h" 13 14 class cmLocalGenerator; 15 class cmMakefile; 16 class cmGeneratorTarget; 17 class cmXMLWriter; 18 class cmSourceFile; 19 20 class cmExtraCodeLiteGenerator : public cmExternalMakefileProjectGenerator 21 { 22 protected: 23 std::string ConfigName; 24 std::string WorkspacePath; 25 unsigned int CpuCount = 2; 26 27 std::string GetCodeLiteCompilerName(const cmMakefile* mf) const; 28 std::string GetConfigurationName(const cmMakefile* mf) const; 29 std::string GetBuildCommand(const cmMakefile* mf, 30 const std::string& targetName) const; 31 std::string GetCleanCommand(const cmMakefile* mf, 32 const std::string& targetName) const; 33 std::string GetRebuildCommand(const cmMakefile* mf, 34 const std::string& targetName) const; 35 std::string GetSingleFileBuildCommand(const cmMakefile* mf) const; 36 std::vector<std::string> CreateProjectsByTarget(cmXMLWriter* xml); 37 std::vector<std::string> CreateProjectsByProjectMaps(cmXMLWriter* xml); 38 std::string CollectSourceFiles(const cmMakefile* makefile, 39 const cmGeneratorTarget* gt, 40 std::map<std::string, cmSourceFile*>& cFiles, 41 std::set<std::string>& otherFiles); 42 void FindMatchingHeaderfiles(std::map<std::string, cmSourceFile*>& cFiles, 43 std::set<std::string>& otherFiles); 44 void CreateProjectSourceEntries(std::map<std::string, cmSourceFile*>& cFiles, 45 std::set<std::string>& otherFiles, 46 cmXMLWriter* xml, 47 const std::string& projectPath, 48 const cmMakefile* mf, 49 const std::string& projectType, 50 const std::string& targetName); 51 void CreateFoldersAndFiles(std::set<std::string>& cFiles, cmXMLWriter& xml, 52 const std::string& projectPath); 53 void CreateFoldersAndFiles(std::map<std::string, cmSourceFile*>& cFiles, 54 cmXMLWriter& xml, const std::string& projectPath); 55 56 public: 57 cmExtraCodeLiteGenerator(); 58 59 static cmExternalMakefileProjectGeneratorFactory* GetFactory(); 60 61 void Generate() override; 62 void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs); 63 64 void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs, 65 const std::string& filename); 66 void CreateNewProjectFile(const cmGeneratorTarget* lg, 67 const std::string& filename); 68 }; 69