cmLocalVisualStudio7Generator.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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 ConvertToXMLOutputPath(const char* path);
  71. std::string ConvertToXMLOutputPathSingle(const char* path);
  72. void OutputDefineFlags(std::ostream& fout);
  73. void OutputTargetRules(std::ostream& fout,
  74. const cmTarget &target,
  75. const char *libName);
  76. void OutputBuildTool(std::ostream& fout, const char* configName,
  77. const char* libname, const cmTarget& t);
  78. void OutputLibraries(std::ostream& fout,
  79. const char* configName,
  80. const char* libName,
  81. const cmTarget &target);
  82. void OutputLibraryDirectories(std::ostream& fout,
  83. const char* configName,
  84. const char* libName,
  85. const cmTarget &target);
  86. void OutputModuleDefinitionFile(std::ostream& fout,
  87. const cmTarget &target);
  88. void WriteProjectStart(std::ostream& fout, const char *libName,
  89. const cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
  90. void WriteVCProjBeginGroup(std::ostream& fout,
  91. const char* group,
  92. const char* filter);
  93. void WriteVCProjEndGroup(std::ostream& fout);
  94. std::string CombineCommands(const cmSourceGroup::Commands &commands,
  95. cmSourceGroup::CommandFiles &totalCommand,
  96. const char *source);
  97. void WriteCustomRule(std::ostream& fout,
  98. const char* source,
  99. const char* command,
  100. const std::set<std::string>& depends,
  101. const std::set<std::string>& outputs,
  102. const char* extraFlags);
  103. std::vector<std::string> m_CreatedProjectNames;
  104. std::string m_LibraryOutputPath;
  105. std::string m_ExecutableOutputPath;
  106. std::string m_ModuleDefinitionFile;
  107. /*
  108. std::string m_DSPHeaderTemplate;
  109. std::string m_DSPFooterTemplate;
  110. void WriteDSPBeginGroup(std::ostream& fout,
  111. const char* group,
  112. const char* filter);
  113. void WriteDSPEndGroup(std::ostream& fout);
  114. void WriteCustomRule(std::ostream& fout,
  115. const char* source,
  116. const char* command,
  117. const std::set<std::string>& depends,
  118. const std::set<std::string>& outputs,
  119. const char* flags);
  120. std::string CreateTargetRules(const cmTarget &target,
  121. const char *libName);
  122. std::string CombineCommands(const cmSourceGroup::Commands &commands,
  123. cmSourceGroup::CommandFiles &totalCommand,
  124. const char *source);
  125. std::string m_IncludeOptions;
  126. std::vector<std::string> m_Configurations;
  127. */
  128. };
  129. #endif