cmLocalVisualStudio6Generator.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 cmLocalVisualStudio6Generator_h
  11. #define cmLocalVisualStudio6Generator_h
  12. #include "cmLocalVisualStudioGenerator.h"
  13. class cmTarget;
  14. class cmSourceFile;
  15. class cmSourceGroup;
  16. class cmCustomCommand;
  17. /** \class cmLocalVisualStudio6Generator
  18. * \brief Write a LocalUnix makefiles.
  19. *
  20. * cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
  21. * member this->Makefile.
  22. */
  23. class cmLocalVisualStudio6Generator : public cmLocalVisualStudioGenerator
  24. {
  25. public:
  26. ///! Set cache only and recurse to false by default.
  27. cmLocalVisualStudio6Generator(cmGlobalGenerator* gg,
  28. cmLocalGenerator* parent,
  29. cmState::Snapshot snapshot);
  30. virtual ~cmLocalVisualStudio6Generator();
  31. virtual void AddHelperCommands();
  32. virtual void AddCMakeListsRules();
  33. /**
  34. * Generate the makefile for this directory.
  35. */
  36. virtual void Generate();
  37. void OutputDSPFile();
  38. enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
  39. /**
  40. * Specify the type of the build: static, dll, or executable.
  41. */
  42. void SetBuildType(BuildType, const std::string& libName, cmTarget&);
  43. virtual std::string GetTargetDirectory(cmTarget const& target) const;
  44. virtual std::string ComputeLongestObjectDirectory(cmTarget&) const;
  45. private:
  46. std::string DSPHeaderTemplate;
  47. std::string DSPFooterTemplate;
  48. void CreateSingleDSP(const std::string& lname, cmTarget &tgt);
  49. void WriteDSPFile(std::ostream& fout, const std::string& libName,
  50. cmTarget &tgt);
  51. void WriteDSPBeginGroup(std::ostream& fout,
  52. const char* group,
  53. const char* filter);
  54. void WriteDSPEndGroup(std::ostream& fout);
  55. void WriteDSPHeader(std::ostream& fout, const std::string& libName,
  56. cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  57. void WriteDSPFooter(std::ostream& fout);
  58. void AddDSPBuildRule(cmTarget& tgt);
  59. void WriteCustomRule(std::ostream& fout,
  60. const char* source,
  61. const cmCustomCommand& command,
  62. const char* flags);
  63. void AddUtilityCommandHack(cmTarget& target, int count,
  64. std::vector<std::string>& depends,
  65. const cmCustomCommand& origCommand);
  66. void WriteGroup(const cmSourceGroup *sg, cmTarget& target,
  67. std::ostream &fout, const std::string& libName);
  68. class EventWriter;
  69. friend class EventWriter;
  70. cmsys::auto_ptr<cmCustomCommand>
  71. MaybeCreateOutputDir(cmTarget& target, const std::string& config);
  72. std::string CreateTargetRules(cmTarget &target,
  73. const std::string& configName,
  74. const std::string& libName);
  75. void ComputeLinkOptions(cmTarget& target, const std::string& configName,
  76. const std::string extraOptions,
  77. std::string& options);
  78. void OutputObjects(cmTarget& target, const char* tool,
  79. std::string& options);
  80. std::string GetTargetIncludeOptions(cmTarget &target,
  81. const std::string& config);
  82. std::vector<std::string> Configurations;
  83. std::string GetConfigName(std::string const& configuration) const;
  84. // Special definition check for VS6.
  85. virtual bool CheckDefinition(std::string const& define) const;
  86. };
  87. #endif