cmGlobalVisualStudio6Generator.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 void GenerateBuildCommand(
  46. std::vector<std::string>& makeCommand,
  47. const char* makeProgram,
  48. const std::string& projectName,
  49. const char* projectDir,
  50. const std::string& targetName,
  51. const std::string& config,
  52. bool fast,
  53. std::vector<std::string> const& makeOptions = std::vector<std::string>()
  54. );
  55. /**
  56. * Generate the all required files for building this project/tree. This
  57. * basically creates a series of LocalGenerators for each directory and
  58. * requests that they Generate.
  59. */
  60. virtual void Generate();
  61. /**
  62. * Generate the DSW workspace file.
  63. */
  64. virtual void OutputDSWFile();
  65. virtual void OutputDSWFile(cmLocalGenerator* root,
  66. std::vector<cmLocalGenerator*>& generators);
  67. virtual void WriteDSWFile(std::ostream& fout,
  68. cmLocalGenerator* root,
  69. std::vector<cmLocalGenerator*>& generators);
  70. /** Append the subdirectory for the given configuration. */
  71. virtual void AppendDirectoryForConfig(const std::string& prefix,
  72. const std::string& config,
  73. const std::string& suffix,
  74. std::string& dir);
  75. ///! What is the configurations directory variable called?
  76. virtual const char* GetCMakeCFGIntDir() const { return "$(IntDir)"; }
  77. virtual void FindMakeProgram(cmMakefile*);
  78. protected:
  79. virtual const char* GetIDEVersion() { return "6.0"; }
  80. private:
  81. virtual std::string GetVSMakeProgram() { return this->GetMSDevCommand(); }
  82. void GenerateConfigurations(cmMakefile* mf);
  83. void WriteDSWFile(std::ostream& fout);
  84. void WriteDSWHeader(std::ostream& fout);
  85. void WriteProject(std::ostream& fout,
  86. const std::string& name, const char* path,
  87. cmTarget const& t);
  88. void WriteExternalProject(std::ostream& fout,
  89. const std::string& name, const char* path,
  90. const std::set<std::string>& dependencies);
  91. void WriteDSWFooter(std::ostream& fout);
  92. virtual std::string WriteUtilityDepend(cmTarget const* target);
  93. std::string MSDevCommand;
  94. bool MSDevCommandInitialized;
  95. std::string const& GetMSDevCommand();
  96. std::string FindMSDevCommand();
  97. };
  98. #endif