cmLocalVisualStudio6Generator.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. /**
  41. * Return array of created DSP names in a STL vector.
  42. * Each executable must have its own dsp.
  43. */
  44. std::vector<std::string> GetCreatedProjectNames()
  45. {
  46. return this->CreatedProjectNames;
  47. }
  48. virtual std::string GetTargetDirectory(cmTarget const& target) const;
  49. void GetTargetObjectFileDirectories(cmTarget* target,
  50. std::vector<std::string>&
  51. dirs);
  52. private:
  53. std::string DSPHeaderTemplate;
  54. std::string DSPFooterTemplate;
  55. std::vector<std::string> CreatedProjectNames;
  56. void CreateSingleDSP(const char *lname, cmTarget &tgt);
  57. void WriteDSPFile(std::ostream& fout, const char *libName,
  58. cmTarget &tgt);
  59. void WriteDSPBeginGroup(std::ostream& fout,
  60. const char* group,
  61. const char* filter);
  62. void WriteDSPEndGroup(std::ostream& fout);
  63. void WriteDSPHeader(std::ostream& fout, const char *libName,
  64. cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  65. void WriteDSPFooter(std::ostream& fout);
  66. void AddDSPBuildRule(cmTarget& tgt);
  67. void WriteCustomRule(std::ostream& fout,
  68. const char* source,
  69. const cmCustomCommand& command,
  70. const char* flags);
  71. void AddUtilityCommandHack(cmTarget& target, int count,
  72. std::vector<std::string>& depends,
  73. const cmCustomCommand& origCommand);
  74. void WriteGroup(const cmSourceGroup *sg, cmTarget& target,
  75. std::ostream &fout, const char *libName);
  76. class EventWriter;
  77. friend class EventWriter;
  78. std::string CreateTargetRules(cmTarget &target,
  79. const char* configName,
  80. const char *libName);
  81. void ComputeLinkOptions(cmTarget& target, const char* configName,
  82. const std::string extraOptions,
  83. std::string& options);
  84. std::string IncludeOptions;
  85. std::vector<std::string> Configurations;
  86. std::string GetConfigName(std::string const& configuration) const;
  87. // Special definition check for VS6.
  88. virtual bool CheckDefinition(std::string const& define) const;
  89. };
  90. #endif