cmExtraCodeLiteGenerator.h 2.9 KB

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