cmLocalVisualStudio6Generator.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmLocalVisualStudio6Generator_h
  14. #define cmLocalVisualStudio6Generator_h
  15. #include "cmLocalVisualStudioGenerator.h"
  16. class cmTarget;
  17. class cmSourceFile;
  18. class cmSourceGroup;
  19. class cmCustomCommand;
  20. /** \class cmLocalVisualStudio6Generator
  21. * \brief Write a LocalUnix makefiles.
  22. *
  23. * cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
  24. * member this->Makefile.
  25. */
  26. class cmLocalVisualStudio6Generator : public cmLocalVisualStudioGenerator
  27. {
  28. public:
  29. ///! Set cache only and recurse to false by default.
  30. cmLocalVisualStudio6Generator();
  31. virtual ~cmLocalVisualStudio6Generator();
  32. virtual void AddHelperCommands();
  33. /**
  34. * Generate the makefile for this directory.
  35. */
  36. virtual void Generate();
  37. void OutputDSPFile();
  38. enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
  39. /**
  40. * Specify the type of the build: static, dll, or executable.
  41. */
  42. void SetBuildType(BuildType, const char* libName, cmTarget&);
  43. /**
  44. * Return array of created DSP names in a STL vector.
  45. * Each executable must have its own dsp.
  46. */
  47. std::vector<std::string> GetCreatedProjectNames()
  48. {
  49. return this->CreatedProjectNames;
  50. }
  51. virtual std::string GetTargetDirectory(cmTarget const& target) const;
  52. void GetTargetObjectFileDirectories(cmTarget* target,
  53. std::vector<std::string>&
  54. dirs);
  55. private:
  56. std::string DSPHeaderTemplate;
  57. std::string DSPFooterTemplate;
  58. std::vector<std::string> CreatedProjectNames;
  59. void CreateSingleDSP(const char *lname, cmTarget &tgt);
  60. void WriteDSPFile(std::ostream& fout, const char *libName,
  61. cmTarget &tgt);
  62. void WriteDSPBeginGroup(std::ostream& fout,
  63. const char* group,
  64. const char* filter);
  65. void WriteDSPEndGroup(std::ostream& fout);
  66. void WriteDSPHeader(std::ostream& fout, const char *libName,
  67. cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  68. void WriteDSPFooter(std::ostream& fout);
  69. void AddDSPBuildRule(cmTarget& tgt);
  70. void WriteCustomRule(std::ostream& fout,
  71. const char* source,
  72. const cmCustomCommand& command,
  73. const char* flags);
  74. void AddUtilityCommandHack(cmTarget& target, int count,
  75. std::vector<std::string>& depends,
  76. const cmCustomCommand& origCommand);
  77. void WriteGroup(const cmSourceGroup *sg, cmTarget target,
  78. std::ostream &fout, const char *libName);
  79. std::string CreateTargetRules(cmTarget &target,
  80. const char* configName,
  81. const char *libName);
  82. void ComputeLinkOptions(cmTarget& target, const char* configName,
  83. const std::string extraOptions,
  84. std::string& options);
  85. std::string IncludeOptions;
  86. std::vector<std::string> Configurations;
  87. };
  88. #endif