cmGlobalUnixMakefileGenerator3.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator3
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2005 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 cmGlobalUnixMakefileGenerator3_h
  14. #define cmGlobalUnixMakefileGenerator3_h
  15. #include "cmGlobalGenerator.h"
  16. class cmGeneratedFileStream;
  17. class cmLocalUnixMakefileGenerator3;
  18. /** \class cmGlobalUnixMakefileGenerator3
  19. * \brief Write a Unix makefiles.
  20. *
  21. * cmGlobalUnixMakefileGenerator3 manages UNIX build process for a tree
  22. */
  23. class cmGlobalUnixMakefileGenerator3 : public cmGlobalGenerator
  24. {
  25. public:
  26. cmGlobalUnixMakefileGenerator3();
  27. static cmGlobalGenerator* New() { return new cmGlobalUnixMakefileGenerator3; }
  28. ///! Get the name for the generator.
  29. virtual const char* GetName() const {
  30. return cmGlobalUnixMakefileGenerator3::GetActualName();}
  31. static const char* GetActualName() {return "Unix Makefiles 3";}
  32. /** Get the documentation entry for this generator. */
  33. virtual void GetDocumentation(cmDocumentationEntry& entry) const;
  34. ///! Create a local generator appropriate to this Global Generator3
  35. virtual cmLocalGenerator *CreateLocalGenerator();
  36. /**
  37. * Try to determine system infomation such as shared library
  38. * extension, pthreads, byte order etc.
  39. */
  40. virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *);
  41. /**
  42. * Generate the all required files for building this project/tree. This
  43. * basically creates a series of LocalGenerators for each directory and
  44. * requests that they Generate.
  45. */
  46. virtual void Generate();
  47. protected:
  48. void WriteMainMakefile();
  49. void WriteMainCMakefile();
  50. void WriteBuildMakefile();
  51. void WriteCleanMakefile();
  52. void WriteMainCMakefileLanguageRules(cmGeneratedFileStream& cmakefileStream);
  53. void WriteAllRules(cmLocalUnixMakefileGenerator3 *lg,
  54. std::ostream& makefileStream);
  55. void WriteHelpRule(std::ostream& ruleFileStream);
  56. void WriteConvenienceRules(std::ostream& ruleFileStream,
  57. cmLocalUnixMakefileGenerator3 *,
  58. bool exclude);
  59. void AppendGlobalTargetDepends(std::vector<std::string>& depends,
  60. const cmTarget& target);
  61. void AppendAnyGlobalDepend(std::vector<std::string>& depends, const char* name);
  62. };
  63. #endif