cmGlobalVisualStudio7Generator.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 cmGlobalVisualStudio7Generator_h
  14. #define cmGlobalVisualStudio7Generator_h
  15. #include "cmGlobalVisualStudioGenerator.h"
  16. class cmTarget;
  17. struct cmIDEFlagTable;
  18. /** \class cmGlobalVisualStudio7Generator
  19. * \brief Write a Unix makefiles.
  20. *
  21. * cmGlobalVisualStudio7Generator manages UNIX build process for a tree
  22. */
  23. class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
  24. {
  25. public:
  26. cmGlobalVisualStudio7Generator();
  27. static cmGlobalGenerator* New() {
  28. return new cmGlobalVisualStudio7Generator; }
  29. ///! Get the name for the generator.
  30. virtual const char* GetName() const {
  31. return cmGlobalVisualStudio7Generator::GetActualName();}
  32. static const char* GetActualName() {return "Visual Studio 7";}
  33. ///! Create a local generator appropriate to this Global Generator
  34. virtual cmLocalGenerator *CreateLocalGenerator();
  35. /** Get the documentation entry for this generator. */
  36. virtual void GetDocumentation(cmDocumentationEntry& entry) const;
  37. /**
  38. * Try to determine system infomation such as shared library
  39. * extension, pthreads, byte order etc.
  40. */
  41. virtual void EnableLanguage(std::vector<std::string>const& languages,
  42. cmMakefile *, bool optional);
  43. /**
  44. * Try running cmake and building a file. This is used for dynalically
  45. * loaded commands, not as part of the usual build process.
  46. */
  47. virtual std::string GenerateBuildCommand(const char* makeProgram,
  48. const char *projectName,
  49. const char* additionalOptions,
  50. const char *targetName,
  51. const char* config,
  52. bool ignoreErrors,
  53. bool fast);
  54. /**
  55. * Generate the all required files for building this project/tree. This
  56. * basically creates a series of LocalGenerators for each directory and
  57. * requests that they Generate.
  58. */
  59. virtual void Generate();
  60. /**
  61. * Generate the DSW workspace file.
  62. */
  63. virtual void OutputSLNFile();
  64. /**
  65. * Get the list of configurations
  66. */
  67. std::vector<std::string> *GetConfigurations();
  68. ///! Create a GUID or get an existing one.
  69. void CreateGUID(const char* name);
  70. std::string GetGUID(const char* name);
  71. ///! do configure step
  72. virtual void Configure();
  73. /** Append the subdirectory for the given configuration. */
  74. virtual void AppendDirectoryForConfig(const char* prefix,
  75. const char* config,
  76. const char* suffix,
  77. std::string& dir);
  78. ///! What is the configurations directory variable called?
  79. virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; }
  80. struct TargetCompare
  81. {
  82. bool operator()(cmTarget const* l, cmTarget const* r);
  83. };
  84. protected:
  85. virtual const char* GetIDEVersion() { return "7.0"; }
  86. static cmIDEFlagTable const* GetExtraFlagTableVS7();
  87. virtual void OutputSLNFile(cmLocalGenerator* root,
  88. std::vector<cmLocalGenerator*>& generators);
  89. virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
  90. std::vector<cmLocalGenerator*>& generators);
  91. virtual void WriteProject(std::ostream& fout,
  92. const char* name, const char* path, cmTarget &t);
  93. virtual void WriteProjectDepends(std::ostream& fout,
  94. const char* name, const char* path, cmTarget &t);
  95. virtual void WriteProjectConfigurations(std::ostream& fout,
  96. const char* name,
  97. bool partOfDefaultBuild);
  98. virtual void WriteSLNFooter(std::ostream& fout);
  99. virtual void WriteSLNHeader(std::ostream& fout);
  100. virtual void AddPlatformDefinitions(cmMakefile* mf);
  101. class OrderedTargetDependSet: public std::multiset<cmTarget*, TargetCompare>
  102. {
  103. public:
  104. OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
  105. };
  106. virtual void WriteTargetsToSolution(
  107. std::ostream& fout,
  108. cmLocalGenerator* root,
  109. OrderedTargetDependSet const& projectTargets);
  110. virtual void WriteTargetDepends(
  111. std::ostream& fout,
  112. OrderedTargetDependSet const& projectTargets);
  113. virtual void WriteTargetConfigurations(
  114. std::ostream& fout,
  115. cmLocalGenerator* root,
  116. OrderedTargetDependSet const& projectTargets);
  117. void GenerateConfigurations(cmMakefile* mf);
  118. virtual void WriteExternalProject(std::ostream& fout,
  119. const char* name,
  120. const char* path,
  121. const std::set<cmStdString>&
  122. dependencies);
  123. std::string ConvertToSolutionPath(const char* path);
  124. bool IsPartOfDefaultBuild(const char* project,
  125. cmTarget* target);
  126. std::vector<std::string> Configurations;
  127. std::map<cmStdString, cmStdString> GUIDMap;
  128. // Set during OutputSLNFile with the name of the current project.
  129. // There is one SLN file per project.
  130. std::string CurrentProject;
  131. };
  132. #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
  133. #endif