cmLocalVisualStudio6Generator.h 3.9 KB

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