cmExtraKateGenerator.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2004-2009 Kitware, Inc.
  4. Copyright 2013 Alexander Neundorf ([email protected])
  5. Distributed under the OSI-approved BSD License (the "License");
  6. see accompanying file Copyright.txt for details.
  7. This software is distributed WITHOUT ANY WARRANTY; without even the
  8. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. See the License for more information.
  10. ============================================================================*/
  11. #ifndef cmExtraKateGenerator_h
  12. #define cmExtraKateGenerator_h
  13. #include "cmExternalMakefileProjectGenerator.h"
  14. class cmLocalGenerator;
  15. class cmGeneratedFileStream;
  16. /** \class cmExtraKateGenerator
  17. * \brief Write Kate project files for Makefile or ninja based projects
  18. */
  19. class cmExtraKateGenerator : public cmExternalMakefileProjectGenerator
  20. {
  21. public:
  22. cmExtraKateGenerator();
  23. virtual std::string GetName() const
  24. { return cmExtraKateGenerator::GetActualName();}
  25. static std::string GetActualName() { return "Kate";}
  26. static cmExternalMakefileProjectGenerator* New()
  27. { return new cmExtraKateGenerator; }
  28. /** Get the documentation entry for this generator. */
  29. virtual void GetDocumentation(cmDocumentationEntry& entry,
  30. const std::string& fullName) const;
  31. virtual void Generate();
  32. private:
  33. void CreateKateProjectFile(const cmLocalGenerator* lg) const;
  34. void CreateDummyKateProjectFile(const cmLocalGenerator* lg) const;
  35. void WriteTargets(const cmLocalGenerator* lg,
  36. cmGeneratedFileStream& fout) const;
  37. void AppendTarget(cmGeneratedFileStream& fout,
  38. const std::string& target,
  39. const std::string& make,
  40. const std::string& makeArgs,
  41. const std::string& path,
  42. const char* homeOutputDir) const;
  43. std::string GenerateFilesString(const cmLocalGenerator* lg) const;
  44. std::string GetPathBasename(const std::string& path) const;
  45. std::string GenerateProjectName(const std::string& name,
  46. const std::string& type,
  47. const std::string& path) const;
  48. std::string ProjectName;
  49. bool UseNinja;
  50. };
  51. #endif