cmGlobalVisualStudio10Generator.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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 std::string& name,
  23. const std::string& platformName);
  24. static cmGlobalGeneratorFactory* NewFactory();
  25. virtual bool MatchesGeneratorName(const std::string& name) const;
  26. virtual bool SetSystemName(std::string const& s, cmMakefile* mf);
  27. virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
  28. virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
  29. virtual void GenerateBuildCommand(
  30. std::vector<std::string>& makeCommand,
  31. const std::string& makeProgram,
  32. const std::string& projectName,
  33. const std::string& projectDir,
  34. const std::string& targetName,
  35. const std::string& config,
  36. bool fast,
  37. std::vector<std::string> const& makeOptions = std::vector<std::string>()
  38. );
  39. ///! create the correct local generator
  40. virtual cmLocalGenerator *CreateLocalGenerator();
  41. /**
  42. * Try to determine system information 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. /** Generating for Nsight Tegra VS plugin? */
  51. bool IsNsightTegra() const;
  52. std::string GetNsightTegraVersion() const;
  53. /** The toolset name for the target platform. */
  54. const char* GetPlatformToolset() const;
  55. /** Return the CMAKE_SYSTEM_NAME. */
  56. std::string const& GetSystemName() const { return this->SystemName; }
  57. /** Return the CMAKE_SYSTEM_VERSION. */
  58. std::string const& GetSystemVersion() const { return this->SystemVersion; }
  59. /** Return true if building for WindowsCE */
  60. bool TargetsWindowsCE() const
  61. { return this->SystemIsWindowsCE; }
  62. /** Return true if building for WindowsPhone */
  63. bool TargetsWindowsPhone() const
  64. { return this->SystemIsWindowsPhone; }
  65. /** Return true if building for WindowsStore */
  66. bool TargetsWindowsStore() const
  67. { return this->SystemIsWindowsStore; }
  68. /**
  69. * Where does this version of Visual Studio look for macros for the
  70. * current user? Returns the empty string if this version of Visual
  71. * Studio does not implement support for VB macros.
  72. */
  73. virtual std::string GetUserMacrosDirectory();
  74. /**
  75. * What is the reg key path to "vsmacros" for this version of Visual
  76. * Studio?
  77. */
  78. virtual std::string GetUserMacrosRegKeyBase();
  79. virtual const char* GetCMakeCFGIntDir() const
  80. { return "$(Configuration)";}
  81. bool Find64BitTools(cmMakefile* mf);
  82. /** Generate an <output>.rule file path for a given command output. */
  83. virtual std::string GenerateRuleFile(std::string const& output) const;
  84. void PathTooLong(cmTarget* target, cmSourceFile const* sf,
  85. std::string const& sfRel);
  86. virtual const char* GetToolsVersion() { return "4.0"; }
  87. virtual void FindMakeProgram(cmMakefile*);
  88. static std::string GetInstalledNsightTegraVersion();
  89. protected:
  90. virtual void Generate();
  91. virtual bool InitializeSystem(cmMakefile* mf);
  92. virtual bool InitializeWindowsCE(cmMakefile* mf);
  93. virtual bool InitializeWindowsPhone(cmMakefile* mf);
  94. virtual bool InitializeWindowsStore(cmMakefile* mf);
  95. virtual std::string SelectWindowsCEToolset() const;
  96. virtual std::string SelectWindowsPhoneToolset() const { return ""; }
  97. virtual std::string SelectWindowsStoreToolset() const { return ""; }
  98. virtual const char* GetIDEVersion() { return "10.0"; }
  99. std::string const& GetMSBuildCommand();
  100. std::string GeneratorToolset;
  101. std::string DefaultPlatformToolset;
  102. std::string SystemName;
  103. std::string SystemVersion;
  104. std::string NsightTegraVersion;
  105. bool SystemIsWindowsCE;
  106. bool SystemIsWindowsPhone;
  107. bool SystemIsWindowsStore;
  108. bool ExpressEdition;
  109. bool UseFolderProperty();
  110. private:
  111. class Factory;
  112. struct LongestSourcePath
  113. {
  114. LongestSourcePath(): Length(0), Target(0), SourceFile(0) {}
  115. size_t Length;
  116. cmTarget* Target;
  117. cmSourceFile const* SourceFile;
  118. std::string SourceRel;
  119. };
  120. LongestSourcePath LongestSource;
  121. std::string MSBuildCommand;
  122. bool MSBuildCommandInitialized;
  123. virtual std::string FindMSBuildCommand();
  124. virtual std::string FindDevEnvCommand();
  125. virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); }
  126. };
  127. #endif