cmGlobalVisualStudio10Generator.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmGlobalVisualStudio10Generator_h
  11. #define cmGlobalVisualStudio10Generator_h
  12. #include "cmGlobalVisualStudio8Generator.h"
  13. /** \class cmGlobalVisualStudio10Generator
  14. * \brief Write a Unix makefiles.
  15. *
  16. * cmGlobalVisualStudio10Generator manages UNIX build process for a tree
  17. */
  18. class cmGlobalVisualStudio10Generator :
  19. public cmGlobalVisualStudio8Generator
  20. {
  21. public:
  22. cmGlobalVisualStudio10Generator();
  23. static cmGlobalGenerator* New() {
  24. return new cmGlobalVisualStudio10Generator; }
  25. virtual std::string
  26. GenerateBuildCommand(const char* makeProgram,
  27. const char *projectName,
  28. const char* additionalOptions, const char *targetName,
  29. const char* config, bool ignoreErrors, bool);
  30. ///! Get the name for the generator.
  31. virtual const char* GetName() const {
  32. return cmGlobalVisualStudio10Generator::GetActualName();}
  33. static const char* GetActualName() {return "Visual Studio 10";}
  34. virtual void AddPlatformDefinitions(cmMakefile* mf);
  35. /** Get the documentation entry for this generator. */
  36. virtual void GetDocumentation(cmDocumentationEntry& entry) const;
  37. ///! create the correct local generator
  38. virtual cmLocalGenerator *CreateLocalGenerator();
  39. virtual void Generate();
  40. /**
  41. * Try to determine system infomation such as shared library
  42. * extension, pthreads, byte order etc.
  43. */
  44. virtual void EnableLanguage(std::vector<std::string>const& languages,
  45. cmMakefile *, bool optional);
  46. virtual void WriteSLNHeader(std::ostream& fout);
  47. /** Is the installed VS an Express edition? */
  48. bool IsExpressEdition() const { return this->ExpressEdition; }
  49. /** The toolset name for the target platform. */
  50. const char* GetPlatformToolset();
  51. /**
  52. * Where does this version of Visual Studio look for macros for the
  53. * current user? Returns the empty string if this version of Visual
  54. * Studio does not implement support for VB macros.
  55. */
  56. virtual std::string GetUserMacrosDirectory();
  57. /**
  58. * What is the reg key path to "vsmacros" for this version of Visual
  59. * Studio?
  60. */
  61. virtual std::string GetUserMacrosRegKeyBase();
  62. virtual const char* GetCMakeCFGIntDir() const
  63. { return "$(Configuration)";}
  64. bool Find64BitTools(cmMakefile* mf);
  65. /** Generate an <output>.rule file path for a given command output. */
  66. virtual std::string GenerateRuleFile(std::string const& output) const;
  67. void PathTooLong(cmTarget* target, cmSourceFile* sf,
  68. std::string const& sfRel);
  69. protected:
  70. virtual const char* GetIDEVersion() { return "10.0"; }
  71. std::string PlatformToolset;
  72. bool ExpressEdition;
  73. bool UseFolderProperty();
  74. private:
  75. struct LongestSourcePath
  76. {
  77. LongestSourcePath(): Length(0), Target(0), SourceFile(0) {}
  78. size_t Length;
  79. cmTarget* Target;
  80. cmSourceFile* SourceFile;
  81. std::string SourceRel;
  82. };
  83. LongestSourcePath LongestSource;
  84. };
  85. #endif