cmLocalVisualStudio6Generator.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 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.
  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, const 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 m_CreatedProjectNames;
  50. }
  51. private:
  52. std::string m_DSPHeaderTemplate;
  53. std::string m_DSPFooterTemplate;
  54. std::vector<std::string> m_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. const cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  64. void WriteDSPFooter(std::ostream& fout);
  65. void AddDSPBuildRule();
  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 char* output,
  72. const char* flags);
  73. std::string CreateTargetRules(const cmTarget &target,
  74. const char *libName);
  75. std::string m_IncludeOptions;
  76. std::vector<std::string> m_Configurations;
  77. };
  78. #endif