cmLocalVisualStudio6Generator.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 "cmLocalGenerator.h"
  16. class cmMakeDepend;
  17. class cmTarget;
  18. class cmSourceFile;
  19. class cmSourceGroup;
  20. class cmCustomCommand;
  21. /** \class cmLocalVisualStudio6Generator
  22. * \brief Write a LocalUnix makefiles.
  23. *
  24. * cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
  25. * member this->Makefile.
  26. */
  27. class cmLocalVisualStudio6Generator : public cmLocalGenerator
  28. {
  29. public:
  30. ///! Set cache only and recurse to false by default.
  31. cmLocalVisualStudio6Generator();
  32. virtual ~cmLocalVisualStudio6Generator();
  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. private:
  52. std::string DSPHeaderTemplate;
  53. std::string DSPFooterTemplate;
  54. std::vector<std::string> CreatedProjectNames;
  55. void CreateSingleDSP(const char *lname, cmTarget &tgt);
  56. void WriteDSPFile(std::ostream& fout, const char *libName,
  57. cmTarget &tgt);
  58. void WriteDSPBeginGroup(std::ostream& fout,
  59. const char* group,
  60. const char* filter);
  61. void WriteDSPEndGroup(std::ostream& fout);
  62. void WriteDSPHeader(std::ostream& fout, const char *libName,
  63. cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  64. void WriteDSPFooter(std::ostream& fout);
  65. void AddDSPBuildRule(cmTarget& tgt);
  66. void WriteCustomRule(std::ostream& fout,
  67. const char* source,
  68. const char* command,
  69. const char* comment,
  70. const std::vector<std::string>& depends,
  71. const std::vector<std::string>& outputs,
  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 *libName);
  80. std::string IncludeOptions;
  81. std::vector<std::string> Configurations;
  82. };
  83. #endif