cmGlobalVisualStudio7Generator.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 "cmGlobalGenerator.h"
  16. class cmTarget;
  17. /** \class cmGlobalVisualStudio7Generator
  18. * \brief Write a Unix makefiles.
  19. *
  20. * cmGlobalVisualStudio7Generator manages UNIX build process for a tree
  21. */
  22. class cmGlobalVisualStudio7Generator : public cmGlobalGenerator
  23. {
  24. public:
  25. cmGlobalVisualStudio7Generator();
  26. static cmGlobalGenerator* New() {
  27. return new cmGlobalVisualStudio7Generator; }
  28. ///! Get the name for the generator.
  29. virtual const char* GetName() const {
  30. return cmGlobalVisualStudio7Generator::GetActualName();}
  31. static const char* GetActualName() {return "Visual Studio 7";}
  32. ///! Create a local generator appropriate to this Global Generator
  33. virtual cmLocalGenerator *CreateLocalGenerator();
  34. /** Get the documentation entry for this generator. */
  35. virtual void GetDocumentation(cmDocumentationEntry& entry) const;
  36. /**
  37. * Try to determine system infomation such as shared library
  38. * extension, pthreads, byte order etc.
  39. */
  40. virtual void EnableLanguage(std::vector<std::string>const& languages,
  41. cmMakefile *);
  42. /**
  43. * Try running cmake and building a file. This is used for dynalically
  44. * loaded commands, not as part of the usual build process.
  45. */
  46. virtual std::string GenerateBuildCommand(const char* makeProgram,
  47. const char *projectName,
  48. const char* additionalOptions,
  49. const char *targetName,
  50. const char* config,
  51. bool ignoreErrors,
  52. bool fast);
  53. /**
  54. * Generate the all required files for building this project/tree. This
  55. * basically creates a series of LocalGenerators for each directory and
  56. * requests that they Generate.
  57. */
  58. virtual void Generate();
  59. /**
  60. * Generate the DSW workspace file.
  61. */
  62. virtual void OutputSLNFile();
  63. /**
  64. * Get the list of configurations
  65. */
  66. std::vector<std::string> *GetConfigurations();
  67. ///! Create a GUID or get an existing one.
  68. void CreateGUID(const char* name);
  69. std::string GetGUID(const char* name);
  70. ///! do configure step
  71. virtual void Configure();
  72. /** Append the subdirectory for the given configuration. */
  73. virtual void AppendDirectoryForConfig(const char* prefix,
  74. const char* config,
  75. const char* suffix,
  76. std::string& dir);
  77. ///! What is the configurations directory variable called?
  78. virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; }
  79. protected:
  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. void GenerateConfigurations(cmMakefile* mf);
  95. void WriteExternalProject(std::ostream& fout,
  96. const char* name, const char* path,
  97. const std::vector<std::string>& dependencies);
  98. std::string ConvertToSolutionPath(const char* path);
  99. bool IsPartOfDefaultBuild(const char* project,
  100. cmTarget* target);
  101. std::vector<std::string> Configurations;
  102. std::map<cmStdString, cmStdString> GUIDMap;
  103. // Set during OutputSLNFile with the name of the current project.
  104. // There is one SLN file per project.
  105. std::string CurrentProject;
  106. };
  107. #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
  108. #endif