cmGlobalVisualStudio7Generator.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. /** Return true if the target project file should have the option
  78. LinkLibraryDependencies and link to .sln dependencies. */
  79. virtual bool NeedLinkLibraryDependencies(cmTarget&) { return false; }
  80. protected:
  81. virtual const char* GetIDEVersion() { return "7.0"; }
  82. static cmIDEFlagTable const* GetExtraFlagTableVS7();
  83. virtual void OutputSLNFile(cmLocalGenerator* root,
  84. std::vector<cmLocalGenerator*>& generators);
  85. virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
  86. std::vector<cmLocalGenerator*>& generators);
  87. virtual void WriteProject(std::ostream& fout,
  88. const char* name, const char* path, cmTarget &t);
  89. virtual void WriteProjectDepends(std::ostream& fout,
  90. const char* name, const char* path, cmTarget &t);
  91. virtual void WriteProjectConfigurations(std::ostream& fout,
  92. const char* name,
  93. bool partOfDefaultBuild);
  94. virtual void WriteSLNFooter(std::ostream& fout);
  95. virtual void WriteSLNHeader(std::ostream& fout);
  96. virtual std::string WriteUtilityDepend(cmTarget* target);
  97. virtual void AddPlatformDefinitions(cmMakefile* mf);
  98. virtual void WriteTargetsToSolution(
  99. std::ostream& fout,
  100. cmLocalGenerator* root,
  101. OrderedTargetDependSet const& projectTargets);
  102. virtual void WriteTargetDepends(
  103. std::ostream& fout,
  104. OrderedTargetDependSet const& projectTargets);
  105. virtual void WriteTargetConfigurations(
  106. std::ostream& fout,
  107. cmLocalGenerator* root,
  108. OrderedTargetDependSet const& projectTargets);
  109. void GenerateConfigurations(cmMakefile* mf);
  110. virtual void WriteExternalProject(std::ostream& fout,
  111. const char* name,
  112. const char* path,
  113. const std::set<cmStdString>&
  114. dependencies);
  115. std::string ConvertToSolutionPath(const char* path);
  116. bool IsPartOfDefaultBuild(const char* project,
  117. cmTarget* target);
  118. std::vector<std::string> Configurations;
  119. std::map<cmStdString, cmStdString> GUIDMap;
  120. // Set during OutputSLNFile with the name of the current project.
  121. // There is one SLN file per project.
  122. std::string CurrentProject;
  123. };
  124. #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
  125. #endif