cmLocalVisualStudio6Generator.h 3.4 KB

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