cmGlobalVisualStudio7Generator.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. ///! Get the name for the generator.
  27. virtual const char* GetName() {
  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. /**
  33. * Try to determine system infomation such as shared library
  34. * extension, pthreads, byte order etc.
  35. */
  36. virtual void EnableLanguage(const char*, cmMakefile *mf);
  37. /**
  38. * Try running cmake and building a file. This is used for dynalically
  39. * loaded commands, not as part of the usual build process.
  40. */
  41. virtual int TryCompile(const char *srcdir, const char *bindir,
  42. const char *projectName, const char *targetName,
  43. std::string *output);
  44. /**
  45. * Generate the all required files for building this project/tree. This
  46. * basically creates a series of LocalGenerators for each directory and
  47. * requests that they Generate.
  48. */
  49. virtual void Generate();
  50. /**
  51. * Generate the required files for building this directory. This
  52. * basically creates a single LocalGenerators and
  53. * requests that it Generate.
  54. */
  55. virtual void LocalGenerate();
  56. /**
  57. * Generate the DSW workspace file.
  58. */
  59. virtual void OutputSLNFile();
  60. /**
  61. * Get the list of configurations
  62. */
  63. std::vector<std::string> *GetConfigurations();
  64. private:
  65. void SetupTests();
  66. void GenerateConfigurations();
  67. void WriteSLNFile(std::ostream& fout);
  68. void WriteSLNHeader(std::ostream& fout);
  69. void WriteProject(std::ostream& fout,
  70. const char* name, const char* path,
  71. const cmTarget &t);
  72. void WriteProjectDepends(std::ostream& fout,
  73. const char* name, const char* path,
  74. const cmTarget &t);
  75. void WriteProjectConfigurations(std::ostream& fout, const char* name, bool in_all);
  76. void WriteExternalProject(std::ostream& fout,
  77. const char* name, const char* path,
  78. const std::vector<std::string>& dependencies);
  79. void WriteSLNFooter(std::ostream& fout);
  80. std::string CreateGUID(const char* name);
  81. std::vector<std::string> m_Configurations;
  82. std::map<cmStdString, cmStdString> m_GUIDMap;
  83. };
  84. #endif