cmExternalMakefileProjectGenerator.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2007 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmExternalMakefileProjectGenerator_h
  14. #define cmExternalMakefileProjectGenerator_h
  15. #include <vector>
  16. #include <string>
  17. #include "cmDocumentation.h"
  18. class cmGlobalGenerator;
  19. /** \class cmExternalMakefileProjectGenerator
  20. * \brief Base class for generators for "External Makefile based IDE projects".
  21. *
  22. * cmExternalMakefileProjectGenerator is a base class for generators
  23. * for "external makefile based projects", i.e. IDE projects which work
  24. * an already existing makefiles.
  25. * See cmGlobalKdevelopGenerator as an example.
  26. * After the makefiles have been generated by one of the Makefile
  27. * generators, the Generate() method is called and this generator
  28. * can iterate over the local generators and/or projects to produce the
  29. * project files for the IDE.
  30. */
  31. class cmExternalMakefileProjectGenerator
  32. {
  33. public:
  34. virtual ~cmExternalMakefileProjectGenerator() {}
  35. ///! Get the name for this generator.
  36. virtual const char* GetName() const = 0;
  37. /** Get the documentation entry for this generator. */
  38. virtual void GetDocumentation(cmDocumentationEntry& entry,
  39. const char* fullName) const = 0;
  40. ///! set the global generator which will generate the makefiles
  41. virtual void SetGlobalGenerator(cmGlobalGenerator* generator)
  42. {this->GlobalGenerator = generator;}
  43. ///! Return the list of global generators supported by this extra generator
  44. const std::vector<std::string>& GetSupportedGlobalGenerators() const
  45. {return this->SupportedGlobalGenerators;}
  46. ///! Get the name of the global generator for the given full name
  47. const char* GetGlobalGeneratorName(const char* fullName);
  48. /** Create a full name from the given global generator name and the
  49. * extra generator name
  50. */
  51. static std::string CreateFullGeneratorName(const char* globalGenerator,
  52. const char* extraGenerator);
  53. ///! Generate the project files, the Makefiles have already been generated
  54. virtual void Generate() = 0;
  55. protected:
  56. ///! Contains the names of the global generators support by this generator.
  57. std::vector<std::string> SupportedGlobalGenerators;
  58. ///! the global generator which creates the makefiles
  59. const cmGlobalGenerator* GlobalGenerator;
  60. };
  61. #endif