cmDSPWriter.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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);
  33. /**
  34. * Return array of created DSP names in a STL vector.
  35. * Each executable must have its own dsp.
  36. */
  37. std::vector<std::string> GetCreatedProjectNames()
  38. {
  39. return m_CreatedProjectNames;
  40. }
  41. /**
  42. * Return the makefile.
  43. */
  44. cmMakefile* GetMakefile()
  45. {
  46. return m_Makefile;
  47. }
  48. private:
  49. std::string m_DSPHeaderTemplate;
  50. std::string m_DSPFooterTemplate;
  51. std::vector<std::string> m_CreatedProjectNames;
  52. void CreateExecutableDSPFiles();
  53. void CreateSingleDSP();
  54. void WriteDSPFile(std::ostream& fout);
  55. void WriteDSPBeginGroup(std::ostream& fout,
  56. const char* group,
  57. const char* filter);
  58. void WriteDSPEndGroup(std::ostream& fout);
  59. void WriteDSPHeader(std::ostream& fout);
  60. void WriteDSPBuildRules(std::ostream& fout);
  61. void WriteDSPBuildRule(std::ostream& fout, const char*);
  62. void WriteDSPFooter(std::ostream& fout);
  63. void WriteDSPBuildRule(std::ostream& fout);
  64. void WriteCustomRule(std::ostream& fout,
  65. const char* source,
  66. const char* result,
  67. const char* command);
  68. std::string m_IncludeOptions;
  69. std::string m_DebugLibraryOptions;
  70. std::string m_ReleaseLibraryOptions;
  71. cmMakefile* m_Makefile;
  72. };
  73. #endif