cmDSPMakefile.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. const std::string &libs);
  58. void WriteDSPFile(std::ostream& fout, const char *libName,
  59. cmTarget &tgt, const std::string &libs);
  60. void WriteDSPBeginGroup(std::ostream& fout,
  61. const char* group,
  62. const char* filter);
  63. void WriteDSPEndGroup(std::ostream& fout);
  64. void WriteDSPHeader(std::ostream& fout, const char *libName,
  65. const std::string &libs);
  66. void WriteDSPBuildRule(std::ostream& fout, const char*);
  67. void WriteDSPBuildRule(std::ostream& fout);
  68. void WriteDSPFooter(std::ostream& fout);
  69. void AddDSPBuildRule(cmSourceGroup&);
  70. void WriteCustomRule(std::ostream& fout,
  71. const char* command,
  72. const std::set<std::string>& depends,
  73. const std::set<std::string>& outputs);
  74. std::string m_IncludeOptions;
  75. cmMakefile* m_Makefile;
  76. BuildType m_LibraryBuildType;
  77. std::vector<std::string> m_Configurations;
  78. };
  79. #endif