cmGlobalVisualStudio7Generator.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. #include "cmGlobalGeneratorFactory.h"
  14. class cmTarget;
  15. struct cmIDEFlagTable;
  16. /** \class cmGlobalVisualStudio7Generator
  17. * \brief Write a Unix makefiles.
  18. *
  19. * cmGlobalVisualStudio7Generator manages UNIX build process for a tree
  20. */
  21. class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
  22. {
  23. public:
  24. cmGlobalVisualStudio7Generator(const char* platformName = NULL);
  25. ~cmGlobalVisualStudio7Generator();
  26. static cmGlobalGeneratorFactory* NewFactory() {
  27. return new cmGlobalGeneratorSimpleFactory
  28. <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. ///! Get the name for the platform.
  34. const char* GetPlatformName() const { return this->PlatformName.c_str(); }
  35. ///! Create a local generator appropriate to this Global Generator
  36. virtual cmLocalGenerator *CreateLocalGenerator();
  37. virtual void AddPlatformDefinitions(cmMakefile* mf);
  38. /** Get the documentation entry for this generator. */
  39. static void GetDocumentation(cmDocumentationEntry& entry);
  40. /**
  41. * Try to determine system infomation such as shared library
  42. * extension, pthreads, byte order etc.
  43. */
  44. virtual void EnableLanguage(std::vector<std::string>const& languages,
  45. cmMakefile *, bool optional);
  46. /**
  47. * Try running cmake and building a file. This is used for dynamically
  48. * loaded commands, not as part of the usual build process.
  49. */
  50. virtual std::string GenerateBuildCommand(const char* makeProgram,
  51. const char *projectName,
  52. const char *projectDir,
  53. const char* additionalOptions,
  54. const char *targetName,
  55. const char* config,
  56. bool ignoreErrors,
  57. bool fast);
  58. /**
  59. * Generate the all required files for building this project/tree. This
  60. * basically creates a series of LocalGenerators for each directory and
  61. * requests that they Generate.
  62. */
  63. virtual void Generate();
  64. /**
  65. * Generate the DSW workspace file.
  66. */
  67. virtual void OutputSLNFile();
  68. /**
  69. * Get the list of configurations
  70. */
  71. std::vector<std::string> *GetConfigurations();
  72. ///! Create a GUID or get an existing one.
  73. void CreateGUID(const char* name);
  74. std::string GetGUID(const char* name);
  75. /** Append the subdirectory for the given configuration. */
  76. virtual void AppendDirectoryForConfig(const char* prefix,
  77. const char* config,
  78. const char* suffix,
  79. std::string& dir);
  80. ///! What is the configurations directory variable called?
  81. virtual const char* GetCMakeCFGIntDir() const { return "$(OutDir)"; }
  82. /** Return true if the target project file should have the option
  83. LinkLibraryDependencies and link to .sln dependencies. */
  84. virtual bool NeedLinkLibraryDependencies(cmTarget&) { return false; }
  85. const char* GetIntelProjectVersion();
  86. protected:
  87. virtual const char* GetIDEVersion() { return "7.0"; }
  88. static cmIDEFlagTable const* GetExtraFlagTableVS7();
  89. virtual void OutputSLNFile(cmLocalGenerator* root,
  90. std::vector<cmLocalGenerator*>& generators);
  91. virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
  92. std::vector<cmLocalGenerator*>& generators);
  93. virtual void WriteProject(std::ostream& fout,
  94. const char* name, const char* path, cmTarget &t);
  95. virtual void WriteProjectDepends(std::ostream& fout,
  96. const char* name, const char* path, cmTarget &t);
  97. virtual void WriteProjectConfigurations(
  98. std::ostream& fout, const char* name, cmTarget::TargetType type,
  99. const std::set<std::string>& configsPartOfDefaultBuild,
  100. const char* platformMapping = NULL);
  101. virtual void WriteSLNGlobalSections(std::ostream& fout,
  102. cmLocalGenerator* root);
  103. virtual void WriteSLNFooter(std::ostream& fout);
  104. virtual void WriteSLNHeader(std::ostream& fout);
  105. virtual std::string WriteUtilityDepend(cmTarget* target);
  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 char* typeGuid,
  122. const std::set<cmStdString>&
  123. dependencies);
  124. std::string ConvertToSolutionPath(const char* path);
  125. std::set<std::string> IsPartOfDefaultBuild(const char* project,
  126. cmTarget* target);
  127. std::vector<std::string> Configurations;
  128. std::map<cmStdString, cmStdString> GUIDMap;
  129. virtual void WriteFolders(std::ostream& fout);
  130. virtual void WriteFoldersContent(std::ostream& fout);
  131. std::map<std::string,std::set<std::string> > VisualStudioFolders;
  132. // Set during OutputSLNFile with the name of the current project.
  133. // There is one SLN file per project.
  134. std::string CurrentProject;
  135. std::string PlatformName;
  136. private:
  137. char* IntelProjectVersion;
  138. };
  139. #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
  140. #endif