cmExtraSublimeTextGenerator.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2004-2009 Kitware, Inc.
  4. Copyright 2004 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 cmExtraSublimeTextGenerator_h
  12. #define cmExtraSublimeTextGenerator_h
  13. #include "cmExternalMakefileProjectGenerator.h"
  14. class cmLocalGenerator;
  15. class cmMakefile;
  16. class cmTarget;
  17. class cmGeneratedFileStream;
  18. /** \class cmExtraSublimeTextGenerator
  19. * \brief Write Sublime Text 2 project files for Makefile based projects
  20. */
  21. class cmExtraSublimeTextGenerator : public cmExternalMakefileProjectGenerator
  22. {
  23. public:
  24. cmExtraSublimeTextGenerator();
  25. virtual const char* GetName() const
  26. { return cmExtraSublimeTextGenerator::GetActualName();}
  27. static const char* GetActualName()
  28. { return "SublimeText2";}
  29. static cmExternalMakefileProjectGenerator* New()
  30. { return new cmExtraSublimeTextGenerator; }
  31. /** Get the documentation entry for this generator. */
  32. virtual void GetDocumentation(cmDocumentationEntry& entry,
  33. const char* fullName) const;
  34. virtual void Generate();
  35. private:
  36. void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
  37. void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
  38. const std::string& filename);
  39. std::string BuildMakeCommand(const std::string& make, const char* makefile,
  40. const char* target);
  41. void AppendTarget(cmGeneratedFileStream& fout,
  42. const char* targetName,
  43. cmTarget* target,
  44. const char* make,
  45. const cmMakefile* makefile,
  46. const char* compiler,
  47. std::set<std::string>& includeDirs,
  48. std::set<std::string>& defines, bool firstTarget);
  49. };
  50. #endif