cmGlobalVisualStudio7Generator.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmGlobalVisualStudio7Generator_h
  11. #define cmGlobalVisualStudio7Generator_h
  12. #include "cmGlobalVisualStudioGenerator.h"
  13. class cmTarget;
  14. struct cmIDEFlagTable;
  15. /** \class cmGlobalVisualStudio7Generator
  16. * \brief Write a Unix makefiles.
  17. *
  18. * cmGlobalVisualStudio7Generator manages UNIX build process for a tree
  19. */
  20. class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
  21. {
  22. public:
  23. cmGlobalVisualStudio7Generator();
  24. static cmGlobalGenerator* New() {
  25. return new cmGlobalVisualStudio7Generator; }
  26. ///! Get the name for the generator.
  27. virtual const char* GetName() const {
  28. return cmGlobalVisualStudio7Generator::GetActualName();}
  29. static const char* GetActualName() {return "Visual Studio 7";}
  30. ///! Create a local generator appropriate to this Global Generator
  31. virtual cmLocalGenerator *CreateLocalGenerator();
  32. /** Get the documentation entry for this generator. */
  33. virtual void GetDocumentation(cmDocumentationEntry& entry) const;
  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,
  39. cmMakefile *, bool optional);
  40. /**
  41. * Try running cmake and building a file. This is used for dynalically
  42. * loaded commands, not as part of the usual build process.
  43. */
  44. virtual std::string GenerateBuildCommand(const char* makeProgram,
  45. const char *projectName,
  46. const char* additionalOptions,
  47. const char *targetName,
  48. const char* config,
  49. bool ignoreErrors,
  50. bool fast);
  51. /**
  52. * Generate the all required files for building this project/tree. This
  53. * basically creates a series of LocalGenerators for each directory and
  54. * requests that they Generate.
  55. */
  56. virtual void Generate();
  57. /**
  58. * Generate the DSW workspace file.
  59. */
  60. virtual void OutputSLNFile();
  61. /**
  62. * Get the list of configurations
  63. */
  64. std::vector<std::string> *GetConfigurations();
  65. ///! Create a GUID or get an existing one.
  66. void CreateGUID(const char* name);
  67. std::string GetGUID(const char* name);
  68. ///! do configure step
  69. virtual void Configure();
  70. /** Append the subdirectory for the given configuration. */
  71. virtual void AppendDirectoryForConfig(const char* prefix,
  72. const char* config,
  73. const char* suffix,
  74. std::string& dir);
  75. ///! What is the configurations directory variable called?
  76. virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; }
  77. protected:
  78. virtual const char* GetIDEVersion() { return "7.0"; }
  79. static cmIDEFlagTable const* GetExtraFlagTableVS7();
  80. virtual void OutputSLNFile(cmLocalGenerator* root,
  81. std::vector<cmLocalGenerator*>& generators);
  82. virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
  83. std::vector<cmLocalGenerator*>& generators);
  84. virtual void WriteProject(std::ostream& fout,
  85. const char* name, const char* path, cmTarget &t);
  86. virtual void WriteProjectDepends(std::ostream& fout,
  87. const char* name, const char* path, cmTarget &t);
  88. virtual void WriteProjectConfigurations(std::ostream& fout,
  89. const char* name,
  90. bool partOfDefaultBuild);
  91. virtual void WriteSLNFooter(std::ostream& fout);
  92. virtual void WriteSLNHeader(std::ostream& fout);
  93. virtual void AddPlatformDefinitions(cmMakefile* mf);
  94. virtual void WriteTargetsToSolution(
  95. std::ostream& fout,
  96. cmLocalGenerator* root,
  97. OrderedTargetDependSet const& projectTargets);
  98. virtual void WriteTargetDepends(
  99. std::ostream& fout,
  100. OrderedTargetDependSet const& projectTargets);
  101. virtual void WriteTargetConfigurations(
  102. std::ostream& fout,
  103. cmLocalGenerator* root,
  104. OrderedTargetDependSet const& projectTargets);
  105. void GenerateConfigurations(cmMakefile* mf);
  106. virtual void WriteExternalProject(std::ostream& fout,
  107. const char* name,
  108. const char* path,
  109. const std::set<cmStdString>&
  110. dependencies);
  111. std::string ConvertToSolutionPath(const char* path);
  112. bool IsPartOfDefaultBuild(const char* project,
  113. cmTarget* target);
  114. std::vector<std::string> Configurations;
  115. std::map<cmStdString, cmStdString> GUIDMap;
  116. // Set during OutputSLNFile with the name of the current project.
  117. // There is one SLN file per project.
  118. std::string CurrentProject;
  119. };
  120. #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
  121. #endif