cmGlobalVisualStudio7Generator.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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() { return new cmGlobalVisualStudio7Generator; }
  27. ///! Get the name for the generator.
  28. virtual const char* GetName() const {
  29. return cmGlobalVisualStudio7Generator::GetActualName();}
  30. static const char* GetActualName() {return "Visual Studio 7";}
  31. ///! Create a local generator appropriate to this Global Generator
  32. virtual cmLocalGenerator *CreateLocalGenerator();
  33. /** Get the documentation entry for this generator. */
  34. virtual void GetDocumentation(cmDocumentationEntry& entry) const;
  35. /**
  36. * Try to determine system infomation such as shared library
  37. * extension, pthreads, byte order etc.
  38. */
  39. virtual void EnableLanguage(std::vector<std::string>const& languages,
  40. cmMakefile *);
  41. /**
  42. * Try running cmake and building a file. This is used for dynalically
  43. * loaded commands, not as part of the usual build process.
  44. */
  45. virtual std::string GenerateBuildCommand(const char* makeProgram,
  46. const char *projectName,
  47. const char* additionalOptions,
  48. const char *targetName,
  49. const char* config,
  50. bool ignoreErrors);
  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. protected:
  78. virtual void OutputSLNFile(cmLocalGenerator* root,
  79. std::vector<cmLocalGenerator*>& generators);
  80. virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
  81. std::vector<cmLocalGenerator*>& generators);
  82. virtual void WriteProject(std::ostream& fout,
  83. const char* name, const char* path, cmTarget &t);
  84. virtual void WriteProjectDepends(std::ostream& fout,
  85. const char* name, const char* path, cmTarget &t);
  86. virtual void WriteProjectConfigurations(std::ostream& fout, const char* name,
  87. bool in_all);
  88. virtual void WriteSLNFooter(std::ostream& fout);
  89. virtual void WriteSLNHeader(std::ostream& fout);
  90. void GenerateConfigurations(cmMakefile* mf);
  91. void WriteExternalProject(std::ostream& fout,
  92. const char* name, const char* path,
  93. const std::vector<std::string>& dependencies);
  94. std::vector<std::string> Configurations;
  95. std::map<cmStdString, cmStdString> GUIDMap;
  96. // Set during OutputSLNFile with the name of the current project.
  97. // There is one SLN file per project.
  98. std::string CurrentProject;
  99. };
  100. #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
  101. #endif