cmGlobalVisualStudio7Generator.h 5.9 KB

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