cmLocalVisualStudio6Generator.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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();
  28. virtual ~cmLocalVisualStudio6Generator();
  29. virtual void AddHelperCommands();
  30. /**
  31. * Generate the makefile for this directory.
  32. */
  33. virtual void Generate();
  34. void OutputDSPFile();
  35. enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
  36. /**
  37. * Specify the type of the build: static, dll, or executable.
  38. */
  39. void SetBuildType(BuildType, const char* libName, cmTarget&);
  40. virtual std::string GetTargetDirectory(cmTarget const& target) const;
  41. void GetTargetObjectFileDirectories(cmTarget* target,
  42. std::vector<std::string>&
  43. dirs);
  44. private:
  45. std::string DSPHeaderTemplate;
  46. std::string DSPFooterTemplate;
  47. void CreateSingleDSP(const char *lname, cmTarget &tgt);
  48. void WriteDSPFile(std::ostream& fout, const char *libName,
  49. cmTarget &tgt);
  50. void WriteDSPBeginGroup(std::ostream& fout,
  51. const char* group,
  52. const char* filter);
  53. void WriteDSPEndGroup(std::ostream& fout);
  54. void WriteDSPHeader(std::ostream& fout, const char *libName,
  55. cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  56. void WriteDSPFooter(std::ostream& fout);
  57. void AddDSPBuildRule(cmTarget& tgt);
  58. void WriteCustomRule(std::ostream& fout,
  59. const char* source,
  60. const cmCustomCommand& command,
  61. const char* flags);
  62. void AddUtilityCommandHack(cmTarget& target, int count,
  63. std::vector<std::string>& depends,
  64. const cmCustomCommand& origCommand);
  65. void WriteGroup(const cmSourceGroup *sg, cmTarget& target,
  66. std::ostream &fout, const char *libName);
  67. class EventWriter;
  68. friend class EventWriter;
  69. cmsys::auto_ptr<cmCustomCommand>
  70. MaybeCreateOutputDir(cmTarget& target, const char* config);
  71. std::string CreateTargetRules(cmTarget &target,
  72. const char* configName,
  73. const char *libName);
  74. void ComputeLinkOptions(cmTarget& target, const char* configName,
  75. const std::string extraOptions,
  76. std::string& options);
  77. std::string IncludeOptions;
  78. std::vector<std::string> Configurations;
  79. std::string GetConfigName(std::string const& configuration) const;
  80. // Special definition check for VS6.
  81. virtual bool CheckDefinition(std::string const& define) const;
  82. };
  83. #endif