cmGlobalCodeWarriorGenerator.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. 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 cmGlobalCodeWarriorGenerator_h
  14. #define cmGlobalCodeWarriorGenerator_h
  15. #include "cmGlobalGenerator.h"
  16. class cmTarget;
  17. /** \class cmGlobalCodeWarriorGenerator
  18. * \brief Write a Unix makefiles.
  19. *
  20. * cmGlobalCodeWarriorGenerator manages UNIX build process for a tree
  21. */
  22. class cmGlobalCodeWarriorGenerator : public cmGlobalGenerator
  23. {
  24. public:
  25. static cmGlobalGenerator* New() { return new cmGlobalCodeWarriorGenerator; }
  26. ///! Get the name for the generator.
  27. virtual const char* GetName() const {
  28. return cmGlobalCodeWarriorGenerator::GetActualName();}
  29. static const char* GetActualName() {return "Code Warrior Not Working";}
  30. /** Get the documentation entry for this generator. */
  31. virtual void GetDocumentation(cmDocumentationEntry& entry) const;
  32. ///! Create a local generator appropriate to this Global Generator
  33. virtual cmLocalGenerator *CreateLocalGenerator();
  34. /**
  35. * Try to determine system infomation such as shared library
  36. * extension, pthreads, byte order etc.
  37. */
  38. virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *);
  39. /**
  40. * Try running cmake and building a file. This is used for dynalically
  41. * loaded commands, not as part of the usual build process.
  42. */
  43. virtual int TryCompile(const char *srcdir, const char *bindir,
  44. const char *projectName, const char *targetName,
  45. std::string *output, cmMakefile* mf);
  46. /**
  47. * Generate the all required files for building this project/tree. This
  48. * basically creates a series of LocalGenerators for each directory and
  49. * requests that they Generate.
  50. */
  51. virtual void Generate();
  52. /**
  53. * Generate the required files for building this directory. This
  54. * basically creates a single LocalGenerators and
  55. * requests that it Generate.
  56. */
  57. virtual void LocalGenerate();
  58. /**
  59. * Generate the DSW workspace file.
  60. */
  61. virtual void OutputProject();
  62. private:
  63. cmTarget *GetTargetFromName(const char *tgtName);
  64. void WriteProject(std::ostream & fout);
  65. void WriteProjectHeader(std::ostream & fout);
  66. void WriteTargetList(std::ostream & fout);
  67. void WriteTargetOrder(std::ostream & fout);
  68. void WriteGroupList(std::ostream & fout);
  69. void ComputeTargetOrder(std::vector<std::string> &tgtOrder,
  70. const char *tgtName, cmTarget const *tgt);
  71. };
  72. #endif