cmLocalVisualStudio7Generator.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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 cmLocalVisualStudio7Generator_h
  14. #define cmLocalVisualStudio7Generator_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 cmLocalVisualStudio7Generator
  22. * \brief Write a LocalUnix makefiles.
  23. *
  24. * cmLocalVisualStudio7Generator produces a LocalUnix makefile from its
  25. * member m_Makefile.
  26. */
  27. class cmLocalVisualStudio7Generator : public cmLocalGenerator
  28. {
  29. public:
  30. ///! Set cache only and recurse to false by default.
  31. cmLocalVisualStudio7Generator();
  32. virtual ~cmLocalVisualStudio7Generator();
  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. enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
  42. /**
  43. * Specify the type of the build: static, dll, or executable.
  44. */
  45. void SetBuildType(BuildType,const char *name);
  46. /**
  47. * Return array of created DSP names in a STL vector.
  48. * Each executable must have its own dsp.
  49. */
  50. std::vector<std::string> GetCreatedProjectNames()
  51. {
  52. return m_CreatedProjectNames;
  53. }
  54. private:
  55. void OutputVCProjFile();
  56. void WriteVCProjHeader(std::ostream& fout, const char *libName,
  57. const cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  58. void WriteVCProjFooter(std::ostream& fout);
  59. void CreateSingleVCProj(const char *lname, cmTarget &tgt);
  60. void WriteVCProjFile(std::ostream& fout, const char *libName,
  61. cmTarget &tgt);
  62. void AddVCProjBuildRule(cmSourceGroup&);
  63. void WriteConfigurations(std::ostream& fout,
  64. const char *libName,
  65. const cmTarget &tgt);
  66. void WriteConfiguration(std::ostream& fout,
  67. const char* configName,
  68. const char* libName,
  69. const cmTarget &tgt);
  70. std::string EscapeForXML(const char* s);
  71. std::string ConvertToXMLOutputPath(const char* path);
  72. std::string ConvertToXMLOutputPathSingle(const char* path);
  73. void OutputDefineFlags(std::ostream& fout);
  74. void OutputTargetRules(std::ostream& fout,
  75. const cmTarget &target,
  76. const char *libName);
  77. void OutputBuildTool(std::ostream& fout, const char* configName,
  78. const char* libname, const cmTarget& t);
  79. void OutputLibraries(std::ostream& fout,
  80. const char* configName,
  81. const char* libName,
  82. const cmTarget &target);
  83. void OutputLibraryDirectories(std::ostream& fout,
  84. const char* configName,
  85. const char* libName,
  86. const cmTarget &target);
  87. void OutputModuleDefinitionFile(std::ostream& fout,
  88. const cmTarget &target);
  89. void WriteProjectStart(std::ostream& fout, const char *libName,
  90. const cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  91. void WriteVCProjBeginGroup(std::ostream& fout,
  92. const char* group,
  93. const char* filter);
  94. void WriteVCProjEndGroup(std::ostream& fout);
  95. std::string CombineCommands(const cmSourceGroup::Commands &commands,
  96. cmSourceGroup::CommandFiles &totalCommand,
  97. const char *source);
  98. void WriteCustomRule(std::ostream& fout,
  99. const char* source,
  100. const char* command,
  101. const char* comment,
  102. const std::set<std::string>& depends,
  103. const std::set<std::string>& outputs,
  104. const char* extraFlags);
  105. std::vector<std::string> m_CreatedProjectNames;
  106. std::string m_LibraryOutputPath;
  107. std::string m_ExecutableOutputPath;
  108. std::string m_ModuleDefinitionFile;
  109. /*
  110. std::string m_DSPHeaderTemplate;
  111. std::string m_DSPFooterTemplate;
  112. void WriteDSPBeginGroup(std::ostream& fout,
  113. const char* group,
  114. const char* filter);
  115. void WriteDSPEndGroup(std::ostream& fout);
  116. void WriteCustomRule(std::ostream& fout,
  117. const char* source,
  118. const char* command,
  119. const std::set<std::string>& depends,
  120. const std::set<std::string>& outputs,
  121. const char* flags);
  122. std::string CreateTargetRules(const cmTarget &target,
  123. const char *libName);
  124. std::string CombineCommands(const cmSourceGroup::Commands &commands,
  125. cmSourceGroup::CommandFiles &totalCommand,
  126. const char *source);
  127. std::string m_IncludeOptions;
  128. std::vector<std::string> m_Configurations;
  129. */
  130. };
  131. #endif