cmExtraCodeBlocksGenerator.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. Copyright (c) 2004 Alexander Neundorf, [email protected]. All rights reserved.
  9. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  10. This software is distributed WITHOUT ANY WARRANTY; without even
  11. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  12. PURPOSE. See the above copyright notices for more information.
  13. =========================================================================*/
  14. #ifndef cmExtraCodeBlocksGenerator_h
  15. #define cmExtraCodeBlocksGenerator_h
  16. #include "cmExternalMakefileProjectGenerator.h"
  17. class cmLocalGenerator;
  18. class cmMakefile;
  19. class cmTarget;
  20. class cmGeneratedFileStream;
  21. /** \class cmExtraCodeBlocksGenerator
  22. * \brief Write CodeBlocks project files for Makefile based projects
  23. *
  24. * This generator is in early alpha stage.
  25. */
  26. class cmExtraCodeBlocksGenerator : public cmExternalMakefileProjectGenerator
  27. {
  28. public:
  29. cmExtraCodeBlocksGenerator();
  30. virtual void SetGlobalGenerator(cmGlobalGenerator* generator);
  31. virtual const char* GetName() const
  32. { return cmExtraCodeBlocksGenerator::GetActualName();}
  33. static const char* GetActualName() { return "CodeBlocks";}
  34. static cmExternalMakefileProjectGenerator* New()
  35. { return new cmExtraCodeBlocksGenerator; }
  36. /** Get the documentation entry for this generator. */
  37. virtual void GetDocumentation(cmDocumentationEntry& entry,
  38. const char* fullName) const;
  39. virtual void Generate();
  40. private:
  41. void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
  42. void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
  43. const std::string& filename);
  44. std::string GetCBCompilerId(const cmMakefile* mf);
  45. int GetCBTargetType(cmTarget* target);
  46. std::string BuildMakeCommand(const std::string& make, const char* makefile,
  47. const char* target);
  48. void AppendTarget(cmGeneratedFileStream& fout,
  49. const char* targetName,
  50. cmTarget* target,
  51. const char* make,
  52. const cmMakefile* makefile,
  53. const char* compiler);
  54. };
  55. #endif