cmGlobalVisualStudio7Generator.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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. ///! Get the name for the generator.
  26. virtual const char* GetName() {
  27. return cmGlobalVisualStudio7Generator::GetActualName();}
  28. static const char* GetActualName() {return "Visual Studio 7";}
  29. ///! Create a local generator appropriate to this Global Generator
  30. virtual cmLocalGenerator *CreateLocalGenerator();
  31. /**
  32. * Try to determine system infomation such as shared library
  33. * extension, pthreads, byte order etc.
  34. */
  35. virtual void EnableLanguage(const char*, cmMakefile *mf);
  36. /**
  37. * Try running cmake and building a file. This is used for dynalically
  38. * loaded commands, not as part of the usual build process.
  39. */
  40. virtual int TryCompile(const char *srcdir, const char *bindir,
  41. const char *projectName, const char *targetName);
  42. /**
  43. * Generate the all required files for building this project/tree. This
  44. * basically creates a series of LocalGenerators for each directory and
  45. * requests that they Generate.
  46. */
  47. virtual void Generate();
  48. /**
  49. * Generate the DSW workspace file.
  50. */
  51. virtual void OutputSLNFile();
  52. /**
  53. * Get the list of configurations
  54. */
  55. std::vector<std::string> *GetConfigurations()
  56. {
  57. return &m_Configurations;
  58. };
  59. private:
  60. void SetupTests();
  61. void GenerateConfigurations();
  62. void WriteSLNFile(std::ostream& fout);
  63. void WriteSLNHeader(std::ostream& fout);
  64. void WriteProject(std::ostream& fout,
  65. const char* name, const char* path,
  66. const cmTarget &t);
  67. void WriteProjectDepends(std::ostream& fout,
  68. const char* name, const char* path,
  69. const cmTarget &t);
  70. void WriteProjectConfigurations(std::ostream& fout, const char* name);
  71. void WriteExternalProject(std::ostream& fout,
  72. const char* name, const char* path,
  73. const std::vector<std::string>& dependencies);
  74. void WriteSLNFooter(std::ostream& fout);
  75. std::string CreateGUID(const char* name);
  76. std::vector<std::string> m_Configurations;
  77. std::map<cmStdString, cmStdString> m_GUIDMap;
  78. };
  79. #endif