cmGlobalVisualStudio10Generator.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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(const char* name,
  23. const char* platformName, const char* additionalPlatformDefinition);
  24. static cmGlobalGeneratorFactory* NewFactory();
  25. virtual bool MatchesGeneratorName(const char* name) const;
  26. virtual bool SetGeneratorToolset(std::string const& ts);
  27. virtual void GenerateBuildCommand(
  28. std::vector<std::string>& makeCommand,
  29. const char* makeProgram,
  30. const std::string& projectName,
  31. const std::string& projectDir,
  32. const std::string& targetName,
  33. const std::string& config,
  34. bool fast,
  35. std::vector<std::string> const& makeOptions = std::vector<std::string>()
  36. );
  37. virtual void AddPlatformDefinitions(cmMakefile* mf);
  38. ///! create the correct local generator
  39. virtual cmLocalGenerator *CreateLocalGenerator();
  40. virtual void Generate();
  41. /**
  42. * Try to determine system infomation such as shared library
  43. * extension, pthreads, byte order etc.
  44. */
  45. virtual void EnableLanguage(std::vector<std::string>const& languages,
  46. cmMakefile *, bool optional);
  47. virtual void WriteSLNHeader(std::ostream& fout);
  48. /** Is the installed VS an Express edition? */
  49. bool IsExpressEdition() const { return this->ExpressEdition; }
  50. /** Is the Microsoft Assembler enabled? */
  51. bool IsMasmEnabled() const { return this->MasmEnabled; }
  52. /** The toolset name for the target platform. */
  53. const char* GetPlatformToolset();
  54. /**
  55. * Where does this version of Visual Studio look for macros for the
  56. * current user? Returns the empty string if this version of Visual
  57. * Studio does not implement support for VB macros.
  58. */
  59. virtual std::string GetUserMacrosDirectory();
  60. /**
  61. * What is the reg key path to "vsmacros" for this version of Visual
  62. * Studio?
  63. */
  64. virtual std::string GetUserMacrosRegKeyBase();
  65. virtual const char* GetCMakeCFGIntDir() const
  66. { return "$(Configuration)";}
  67. bool Find64BitTools(cmMakefile* mf);
  68. /** Generate an <output>.rule file path for a given command output. */
  69. virtual std::string GenerateRuleFile(std::string const& output) const;
  70. void PathTooLong(cmTarget* target, cmSourceFile* sf,
  71. std::string const& sfRel);
  72. virtual const char* GetToolsVersion() { return "4.0"; }
  73. virtual void FindMakeProgram(cmMakefile*);
  74. protected:
  75. virtual const char* GetIDEVersion() { return "10.0"; }
  76. std::string const& GetMSBuildCommand();
  77. std::string PlatformToolset;
  78. bool ExpressEdition;
  79. bool MasmEnabled;
  80. bool UseFolderProperty();
  81. private:
  82. class Factory;
  83. struct LongestSourcePath
  84. {
  85. LongestSourcePath(): Length(0), Target(0), SourceFile(0) {}
  86. size_t Length;
  87. cmTarget* Target;
  88. cmSourceFile* SourceFile;
  89. std::string SourceRel;
  90. };
  91. LongestSourcePath LongestSource;
  92. std::string MSBuildCommand;
  93. bool MSBuildCommandInitialized;
  94. virtual std::string FindMSBuildCommand();
  95. virtual std::string FindDevEnvCommand();
  96. virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); }
  97. };
  98. #endif