cmLocalVisualStudio6Generator.h 3.5 KB

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