cmLocalVisualStudio6Generator.h 3.9 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 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 ComputeLongestObjectDirectory(cmTarget&) const;
  42. private:
  43. std::string DSPHeaderTemplate;
  44. std::string DSPFooterTemplate;
  45. void CreateSingleDSP(const std::string& lname, cmGeneratorTarget* tgt);
  46. void WriteDSPFile(std::ostream& fout, const std::string& libName,
  47. cmGeneratorTarget* tgt);
  48. void WriteDSPBeginGroup(std::ostream& fout,
  49. const char* group,
  50. const char* filter);
  51. void WriteDSPEndGroup(std::ostream& fout);
  52. void WriteDSPHeader(std::ostream& fout, const std::string& libName,
  53. cmGeneratorTarget* tgt, std::vector<cmSourceGroup> &sgs);
  54. void WriteDSPFooter(std::ostream& fout);
  55. void AddDSPBuildRule(cmGeneratorTarget* tgt);
  56. void WriteCustomRule(std::ostream& fout,
  57. const char* source,
  58. const cmCustomCommand& command,
  59. const char* flags);
  60. void AddUtilityCommandHack(cmGeneratorTarget* target, int count,
  61. std::vector<std::string>& depends,
  62. const cmCustomCommand& origCommand);
  63. void WriteGroup(const cmSourceGroup *sg, cmGeneratorTarget* target,
  64. std::ostream &fout, const std::string& libName);
  65. class EventWriter;
  66. friend class EventWriter;
  67. cmsys::auto_ptr<cmCustomCommand>
  68. MaybeCreateOutputDir(cmGeneratorTarget *target, const std::string& config);
  69. std::string CreateTargetRules(cmGeneratorTarget* target,
  70. const std::string& configName,
  71. const std::string& libName);
  72. void ComputeLinkOptions(cmGeneratorTarget* target,
  73. const std::string& configName,
  74. const std::string extraOptions,
  75. std::string& options);
  76. void OutputObjects(cmGeneratorTarget* target, const char* tool,
  77. std::string& options);
  78. std::string GetTargetIncludeOptions(cmGeneratorTarget* target,
  79. const std::string& config);
  80. std::vector<std::string> Configurations;
  81. std::string GetConfigName(std::string const& configuration) const;
  82. // Special definition check for VS6.
  83. virtual bool CheckDefinition(std::string const& define) const;
  84. };
  85. #endif