cmLocalVisualStudio6Generator.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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. // please remove me.... Yuck
  20. #include "cmSourceGroup.h"
  21. /** \class cmLocalVisualStudio6Generator
  22. * \brief Write a LocalUnix makefiles.
  23. *
  24. * cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
  25. * member m_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. fromTheTop indicates if this
  35. * is being invoked as part of a global Generate or specific to this
  36. * directory. The difference is that when done from the Top we might skip
  37. * some steps to save time, such as dependency generation for the
  38. * makefiles. This is done by a direct invocation from make.
  39. */
  40. virtual void Generate(bool fromTheTop);
  41. void OutputDSPFile();
  42. enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
  43. /**
  44. * Specify the type of the build: static, dll, or executable.
  45. */
  46. void SetBuildType(BuildType,const char *name);
  47. /**
  48. * Return array of created DSP names in a STL vector.
  49. * Each executable must have its own dsp.
  50. */
  51. std::vector<std::string> GetCreatedProjectNames()
  52. {
  53. return m_CreatedProjectNames;
  54. }
  55. private:
  56. std::string m_DSPHeaderTemplate;
  57. std::string m_DSPFooterTemplate;
  58. std::vector<std::string> m_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. const cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  68. void WriteDSPFooter(std::ostream& fout);
  69. void AddDSPBuildRule(cmSourceGroup&);
  70. void WriteCustomRule(std::ostream& fout,
  71. const char* source,
  72. const char* command,
  73. const std::set<std::string>& depends,
  74. const std::set<std::string>& outputs,
  75. const char* flags);
  76. std::string CreateTargetRules(const cmTarget &target,
  77. const char *libName);
  78. std::string CombineCommands(const cmSourceGroup::Commands &commands,
  79. cmSourceGroup::CommandFiles &totalCommand,
  80. const char *source);
  81. std::string m_IncludeOptions;
  82. std::vector<std::string> m_Configurations;
  83. };
  84. #endif