cmExtraKateGenerator.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 cmMakefile;
  16. class cmTarget;
  17. class cmGeneratedFileStream;
  18. /** \class cmExtraKateGenerator
  19. * \brief Write Kate project files for Makefile or ninja based projects
  20. */
  21. class cmExtraKateGenerator : public cmExternalMakefileProjectGenerator
  22. {
  23. public:
  24. cmExtraKateGenerator();
  25. virtual std::string GetName() const
  26. { return cmExtraKateGenerator::GetActualName();}
  27. static std::string GetActualName() { return "Kate";}
  28. static cmExternalMakefileProjectGenerator* New()
  29. { return new cmExtraKateGenerator; }
  30. /** Get the documentation entry for this generator. */
  31. virtual void GetDocumentation(cmDocumentationEntry& entry,
  32. const std::string& fullName) const;
  33. virtual void Generate();
  34. private:
  35. void CreateKateProjectFile(const cmMakefile* mf) const;
  36. void CreateDummyKateProjectFile(const cmMakefile* mf) const;
  37. void WriteTargets(const cmMakefile* mf, cmGeneratedFileStream& fout) const;
  38. void AppendTarget(cmGeneratedFileStream& fout,
  39. const std::string& target,
  40. const std::string& make,
  41. const std::string& makeArgs,
  42. const std::string& path,
  43. const char* homeOutputDir) const;
  44. std::string GenerateFilesString(const cmMakefile* mf) const;
  45. std::string GetPathBasename(const std::string& path) const;
  46. std::string GenerateProjectName(const std::string& name,
  47. const std::string& type,
  48. const std::string& path) const;
  49. std::string ProjectName;
  50. bool UseNinja;
  51. };
  52. #endif