cmGlobalVisualStudio6Generator.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmGlobalVisualStudio6Generator_h
  11. #define cmGlobalVisualStudio6Generator_h
  12. #include "cmGlobalVisualStudioGenerator.h"
  13. #include "cmGlobalGeneratorFactory.h"
  14. class cmTarget;
  15. /** \class cmGlobalVisualStudio6Generator
  16. * \brief Write a Unix makefiles.
  17. *
  18. * cmGlobalVisualStudio6Generator manages UNIX build process for a tree
  19. */
  20. class cmGlobalVisualStudio6Generator : public cmGlobalVisualStudioGenerator
  21. {
  22. public:
  23. cmGlobalVisualStudio6Generator();
  24. static cmGlobalGeneratorFactory* NewFactory() {
  25. return new cmGlobalGeneratorSimpleFactory
  26. <cmGlobalVisualStudio6Generator>(); }
  27. ///! Get the name for the generator.
  28. virtual const char* GetName() const {
  29. return cmGlobalVisualStudio6Generator::GetActualName();}
  30. static const char* GetActualName() {return "Visual Studio 6";}
  31. /** Get the documentation entry for this generator. */
  32. static void GetDocumentation(cmDocumentationEntry& entry);
  33. ///! Create a local generator appropriate to this Global Generator
  34. virtual cmLocalGenerator *CreateLocalGenerator();
  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 *, bool optional);
  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. bool fast);
  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 OutputDSWFile();
  62. virtual void OutputDSWFile(cmLocalGenerator* root,
  63. std::vector<cmLocalGenerator*>& generators);
  64. virtual void WriteDSWFile(std::ostream& fout,
  65. cmLocalGenerator* root,
  66. std::vector<cmLocalGenerator*>& generators);
  67. /** Append the subdirectory for the given configuration. */
  68. virtual void AppendDirectoryForConfig(const char* prefix,
  69. const char* config,
  70. const char* suffix,
  71. std::string& dir);
  72. ///! What is the configurations directory variable called?
  73. virtual const char* GetCMakeCFGIntDir() const { return "$(IntDir)"; }
  74. protected:
  75. virtual const char* GetIDEVersion() { return "6.0"; }
  76. private:
  77. void GenerateConfigurations(cmMakefile* mf);
  78. void WriteDSWFile(std::ostream& fout);
  79. void WriteDSWHeader(std::ostream& fout);
  80. void WriteProject(std::ostream& fout,
  81. const char* name, const char* path, cmTarget &t);
  82. void WriteExternalProject(std::ostream& fout,
  83. const char* name, const char* path,
  84. const std::set<cmStdString>& dependencies);
  85. void WriteDSWFooter(std::ostream& fout);
  86. virtual std::string WriteUtilityDepend(cmTarget* target);
  87. };
  88. #endif