cmExtraCodeBlocksGenerator.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 cmExtraCodeBlocksGenerator_h
  12. #define cmExtraCodeBlocksGenerator_h
  13. #include <cmConfigure.h>
  14. #include "cmExternalMakefileProjectGenerator.h"
  15. #include <string>
  16. #include <vector>
  17. class cmGeneratorTarget;
  18. class cmLocalGenerator;
  19. class cmMakefile;
  20. class cmXMLWriter;
  21. /** \class cmExtraCodeBlocksGenerator
  22. * \brief Write CodeBlocks project files for Makefile based projects
  23. */
  24. class cmExtraCodeBlocksGenerator : public cmExternalMakefileProjectGenerator
  25. {
  26. public:
  27. cmExtraCodeBlocksGenerator();
  28. static cmExternalMakefileProjectGeneratorFactory* GetFactory();
  29. void Generate() CM_OVERRIDE;
  30. private:
  31. struct CbpUnit
  32. {
  33. std::vector<const cmGeneratorTarget*> Targets;
  34. };
  35. void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
  36. void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
  37. const std::string& filename);
  38. std::string CreateDummyTargetFile(cmLocalGenerator* lg,
  39. cmGeneratorTarget* target) const;
  40. std::string GetCBCompilerId(const cmMakefile* mf);
  41. int GetCBTargetType(cmGeneratorTarget* target);
  42. std::string BuildMakeCommand(const std::string& make, const char* makefile,
  43. const std::string& target,
  44. const std::string& makeFlags);
  45. void AppendTarget(cmXMLWriter& xml, const std::string& targetName,
  46. cmGeneratorTarget* target, const char* make,
  47. const cmLocalGenerator* lg, const char* compiler,
  48. const std::string& makeFlags);
  49. };
  50. #endif