cmExtraCodeLiteGenerator.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <map>
  6. #include <set>
  7. #include <string>
  8. #include <vector>
  9. #include "cmExternalMakefileProjectGenerator.h"
  10. class cmLocalGenerator;
  11. class cmMakefile;
  12. class cmGeneratorTarget;
  13. class cmXMLWriter;
  14. class cmSourceFile;
  15. class cmExtraCodeLiteGenerator : public cmExternalMakefileProjectGenerator
  16. {
  17. protected:
  18. std::string ConfigName;
  19. std::string WorkspacePath;
  20. unsigned int CpuCount = 2;
  21. std::string GetCodeLiteCompilerName(const cmMakefile* mf) const;
  22. std::string GetConfigurationName(const cmMakefile* mf) const;
  23. std::string GetBuildCommand(const cmMakefile* mf,
  24. const std::string& targetName) const;
  25. std::string GetCleanCommand(const cmMakefile* mf,
  26. const std::string& targetName) const;
  27. std::string GetRebuildCommand(const cmMakefile* mf,
  28. const std::string& targetName) const;
  29. std::string GetSingleFileBuildCommand(const cmMakefile* mf) const;
  30. std::vector<std::string> CreateProjectsByTarget(cmXMLWriter* xml);
  31. std::vector<std::string> CreateProjectsByProjectMaps(cmXMLWriter* xml);
  32. std::string CollectSourceFiles(const cmMakefile* makefile,
  33. const cmGeneratorTarget* gt,
  34. std::map<std::string, cmSourceFile*>& cFiles,
  35. std::set<std::string>& otherFiles);
  36. void FindMatchingHeaderfiles(std::map<std::string, cmSourceFile*>& cFiles,
  37. std::set<std::string>& otherFiles);
  38. void CreateProjectSourceEntries(std::map<std::string, cmSourceFile*>& cFiles,
  39. std::set<std::string>& otherFiles,
  40. cmXMLWriter* xml,
  41. const std::string& projectPath,
  42. const cmMakefile* mf,
  43. const std::string& projectType,
  44. const std::string& targetName);
  45. void CreateFoldersAndFiles(std::set<std::string>& cFiles, cmXMLWriter& xml,
  46. const std::string& projectPath);
  47. void CreateFoldersAndFiles(std::map<std::string, cmSourceFile*>& cFiles,
  48. cmXMLWriter& xml, const std::string& projectPath);
  49. public:
  50. cmExtraCodeLiteGenerator();
  51. static cmExternalMakefileProjectGeneratorFactory* GetFactory();
  52. void Generate() override;
  53. void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
  54. void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
  55. const std::string& filename);
  56. void CreateNewProjectFile(const cmGeneratorTarget* lg,
  57. const std::string& filename);
  58. };