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