cmLocalVisualStudio6Generator.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. void GetTargetObjectFileDirectories(cmTarget* target,
  52. std::vector<std::string>&
  53. dirs);
  54. private:
  55. std::string DSPHeaderTemplate;
  56. std::string DSPFooterTemplate;
  57. std::vector<std::string> CreatedProjectNames;
  58. void CreateSingleDSP(const char *lname, cmTarget &tgt);
  59. void WriteDSPFile(std::ostream& fout, const char *libName,
  60. cmTarget &tgt);
  61. void WriteDSPBeginGroup(std::ostream& fout,
  62. const char* group,
  63. const char* filter);
  64. void WriteDSPEndGroup(std::ostream& fout);
  65. void WriteDSPHeader(std::ostream& fout, const char *libName,
  66. cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  67. void WriteDSPFooter(std::ostream& fout);
  68. void AddDSPBuildRule(cmTarget& tgt);
  69. void WriteCustomRule(std::ostream& fout,
  70. const char* source,
  71. const cmCustomCommand& command,
  72. const char* flags);
  73. void AddUtilityCommandHack(cmTarget& target, int count,
  74. std::vector<std::string>& depends,
  75. const cmCustomCommand& origCommand);
  76. void WriteGroup(const cmSourceGroup *sg, cmTarget target,
  77. std::ostream &fout, const char *libName);
  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. };
  87. #endif