cmDSPWriter.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #ifndef cmDSPMakefile_h
  12. #define cmDSPMakefile_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmMakefile.h"
  15. /** \class cmDSPMakefile
  16. * \brief Generate a Microsoft DSP project file.
  17. *
  18. * cmDSPMakefile generates a Microsoft DSP project file.
  19. * See the *.dsptemplate files for information on the templates
  20. * used for making the project files.
  21. */
  22. class cmDSPMakefile
  23. {
  24. public:
  25. cmDSPMakefile(cmMakefile*);
  26. ~cmDSPMakefile();
  27. void OutputDSPFile();
  28. enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE};
  29. /**
  30. * Specify the type of the build: static, dll, or executable.
  31. */
  32. void SetBuildType(BuildType,const char *name);
  33. BuildType GetLibraryBuildType()
  34. {
  35. return m_LibraryBuildType;
  36. }
  37. /**
  38. * Return array of created DSP names in a STL vector.
  39. * Each executable must have its own dsp.
  40. */
  41. std::vector<std::string> GetCreatedProjectNames()
  42. {
  43. return m_CreatedProjectNames;
  44. }
  45. /**
  46. * Return the makefile.
  47. */
  48. cmMakefile* GetMakefile()
  49. {
  50. return m_Makefile;
  51. }
  52. private:
  53. std::string m_DSPHeaderTemplate;
  54. std::string m_DSPFooterTemplate;
  55. std::vector<std::string> m_CreatedProjectNames;
  56. void CreateSingleDSP(const char *lname, cmTarget &tgt);
  57. void WriteDSPFile(std::ostream& fout,
  58. const char *libName, cmTarget &tgt);
  59. void WriteDSPBeginGroup(std::ostream& fout,
  60. const char* group,
  61. const char* filter);
  62. void WriteDSPEndGroup(std::ostream& fout);
  63. void WriteDSPHeader(std::ostream& fout, const char *libName);
  64. void WriteDSPBuildRule(std::ostream& fout, const char*);
  65. void WriteDSPBuildRule(std::ostream& fout);
  66. void WriteDSPFooter(std::ostream& fout);
  67. void AddDSPBuildRule(cmSourceGroup&);
  68. void WriteCustomRule(std::ostream& fout,
  69. const char* command,
  70. const std::set<std::string>& depends,
  71. const std::set<std::string>& outputs);
  72. std::string m_IncludeOptions;
  73. std::string m_LibraryOptions;
  74. cmMakefile* m_Makefile;
  75. BuildType m_LibraryBuildType;
  76. std::vector<std::string> m_Configurations;
  77. };
  78. #endif