cmGlobalVisualStudio6Generator.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 cmGlobalVisualStudio6Generator
  15. * \brief Write a Unix makefiles.
  16. *
  17. * cmGlobalVisualStudio6Generator manages UNIX build process for a tree
  18. */
  19. class cmGlobalVisualStudio6Generator : public cmGlobalVisualStudioGenerator
  20. {
  21. public:
  22. cmGlobalVisualStudio6Generator(cmake* cm);
  23. static cmGlobalGeneratorFactory* NewFactory() {
  24. return new cmGlobalGeneratorSimpleFactory
  25. <cmGlobalVisualStudio6Generator>(); }
  26. ///! Get the name for the generator.
  27. virtual std::string GetName() const {
  28. return cmGlobalVisualStudio6Generator::GetActualName();}
  29. static std::string GetActualName() {return "Visual Studio 6";}
  30. /** Get the documentation entry for this generator. */
  31. static void GetDocumentation(cmDocumentationEntry& entry);
  32. /**
  33. * Utilized by the generator factory to determine if this generator
  34. * supports toolsets.
  35. */
  36. static bool SupportsToolset() { return false; }
  37. ///! Create a local generator appropriate to this Global Generator
  38. virtual cmLocalGenerator *CreateLocalGenerator(cmMakefile* mf);
  39. /**
  40. * Try to determine system information such as shared library
  41. * extension, pthreads, byte order etc.
  42. */
  43. virtual void EnableLanguage(std::vector<std::string>const& languages,
  44. cmMakefile *, bool optional);
  45. /**
  46. * Try running cmake and building a file. This is used for dynalically
  47. * loaded commands, not as part of the usual build process.
  48. */
  49. virtual void GenerateBuildCommand(
  50. std::vector<std::string>& makeCommand,
  51. const std::string& makeProgram,
  52. const std::string& projectName,
  53. const std::string& projectDir,
  54. const std::string& targetName,
  55. const std::string& config,
  56. bool fast, bool verbose,
  57. std::vector<std::string> const& makeOptions = std::vector<std::string>()
  58. );
  59. /**
  60. * Generate the DSW workspace file.
  61. */
  62. virtual void OutputDSWFile();
  63. virtual void OutputDSWFile(cmLocalGenerator* root,
  64. std::vector<cmLocalGenerator*>& generators);
  65. virtual void WriteDSWFile(std::ostream& fout,
  66. cmLocalGenerator* root,
  67. std::vector<cmLocalGenerator*>& generators);
  68. /** Append the subdirectory for the given configuration. */
  69. virtual void AppendDirectoryForConfig(const std::string& prefix,
  70. const std::string& config,
  71. const std::string& suffix,
  72. std::string& dir);
  73. ///! What is the configurations directory variable called?
  74. virtual const char* GetCMakeCFGIntDir() const { return "$(IntDir)"; }
  75. virtual void FindMakeProgram(cmMakefile*);
  76. protected:
  77. virtual void Generate();
  78. virtual const char* GetIDEVersion() { return "6.0"; }
  79. private:
  80. virtual std::string GetVSMakeProgram() { return this->GetMSDevCommand(); }
  81. void GenerateConfigurations(cmMakefile* mf);
  82. void WriteDSWFile(std::ostream& fout);
  83. void WriteDSWHeader(std::ostream& fout);
  84. void WriteProject(std::ostream& fout,
  85. const std::string& name, const char* path,
  86. cmGeneratorTarget const* t);
  87. void WriteExternalProject(std::ostream& fout,
  88. const std::string& name, const char* path,
  89. const std::set<std::string>& dependencies);
  90. void WriteDSWFooter(std::ostream& fout);
  91. virtual std::string WriteUtilityDepend(const cmGeneratorTarget *target);
  92. std::string MSDevCommand;
  93. bool MSDevCommandInitialized;
  94. std::string const& GetMSDevCommand();
  95. std::string FindMSDevCommand();
  96. };
  97. #endif