cmGlobalVisualStudio7Generator.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. /**
  53. * Generate the all required files for building this project/tree. This
  54. * basically creates a series of LocalGenerators for each directory and
  55. * requests that they Generate.
  56. */
  57. virtual void Generate();
  58. /**
  59. * Generate the DSW workspace file.
  60. */
  61. virtual void OutputSLNFile();
  62. /**
  63. * Get the list of configurations
  64. */
  65. std::vector<std::string> *GetConfigurations();
  66. ///! Create a GUID or get an existing one.
  67. void CreateGUID(const char* name);
  68. std::string GetGUID(const char* name);
  69. ///! do configure step
  70. virtual void Configure();
  71. /** Append the subdirectory for the given configuration. */
  72. virtual void AppendDirectoryForConfig(const char* prefix,
  73. const char* config,
  74. const char* suffix,
  75. std::string& dir);
  76. ///! What is the configurations directory variable called?
  77. virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; }
  78. protected:
  79. virtual void OutputSLNFile(cmLocalGenerator* root,
  80. std::vector<cmLocalGenerator*>& generators);
  81. virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
  82. std::vector<cmLocalGenerator*>& generators);
  83. virtual void WriteProject(std::ostream& fout,
  84. const char* name, const char* path, cmTarget &t);
  85. virtual void WriteProjectDepends(std::ostream& fout,
  86. const char* name, const char* path, cmTarget &t);
  87. virtual void WriteProjectConfigurations(std::ostream& fout,
  88. const char* name,
  89. bool in_all);
  90. virtual void WriteSLNFooter(std::ostream& fout);
  91. virtual void WriteSLNHeader(std::ostream& fout);
  92. virtual void AddPlatformDefinitions(cmMakefile* mf);
  93. void GenerateConfigurations(cmMakefile* mf);
  94. void WriteExternalProject(std::ostream& fout,
  95. const char* name, const char* path,
  96. const std::vector<std::string>& dependencies);
  97. std::vector<std::string> Configurations;
  98. std::map<cmStdString, cmStdString> GUIDMap;
  99. // Set during OutputSLNFile with the name of the current project.
  100. // There is one SLN file per project.
  101. std::string CurrentProject;
  102. };
  103. #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
  104. #endif