cmGlobalVisualStudio10Generator.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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(cmake* cm, 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, bool verbose,
  37. std::vector<std::string> const& makeOptions = std::vector<std::string>()
  38. );
  39. virtual bool Compute();
  40. ///! create the correct local generator
  41. virtual cmLocalGenerator *CreateLocalGenerator(cmState::Snapshot snapshot);
  42. /**
  43. * Try to determine system information such as shared library
  44. * extension, pthreads, byte order etc.
  45. */
  46. virtual void EnableLanguage(std::vector<std::string>const& languages,
  47. cmMakefile *, bool optional);
  48. virtual void WriteSLNHeader(std::ostream& fout);
  49. /** Is the installed VS an Express edition? */
  50. bool IsExpressEdition() const { return this->ExpressEdition; }
  51. /** Generating for Nsight Tegra VS plugin? */
  52. bool IsNsightTegra() const;
  53. std::string GetNsightTegraVersion() const;
  54. /** The toolset name for the target platform. */
  55. const char* GetPlatformToolset() const;
  56. /** Return the CMAKE_SYSTEM_NAME. */
  57. std::string const& GetSystemName() const { return this->SystemName; }
  58. /** Return the CMAKE_SYSTEM_VERSION. */
  59. std::string const& GetSystemVersion() const { return this->SystemVersion; }
  60. /** Return true if building for WindowsCE */
  61. bool TargetsWindowsCE() const
  62. { return this->SystemIsWindowsCE; }
  63. /** Return true if building for WindowsPhone */
  64. bool TargetsWindowsPhone() const
  65. { return this->SystemIsWindowsPhone; }
  66. /** Return true if building for WindowsStore */
  67. bool TargetsWindowsStore() const
  68. { return this->SystemIsWindowsStore; }
  69. virtual const char* GetCMakeCFGIntDir() const
  70. { return "$(Configuration)";}
  71. bool Find64BitTools(cmMakefile* mf);
  72. /** Generate an <output>.rule file path for a given command output. */
  73. virtual std::string GenerateRuleFile(std::string const& output) const;
  74. void PathTooLong(cmTarget* target, cmSourceFile const* sf,
  75. std::string const& sfRel);
  76. virtual const char* GetToolsVersion() { return "4.0"; }
  77. virtual void FindMakeProgram(cmMakefile*);
  78. static std::string GetInstalledNsightTegraVersion();
  79. protected:
  80. virtual void Generate();
  81. virtual bool InitializeSystem(cmMakefile* mf);
  82. virtual bool InitializeWindowsCE(cmMakefile* mf);
  83. virtual bool InitializeWindowsPhone(cmMakefile* mf);
  84. virtual bool InitializeWindowsStore(cmMakefile* mf);
  85. virtual std::string SelectWindowsCEToolset() const;
  86. virtual bool SelectWindowsPhoneToolset(std::string& toolset) const;
  87. virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
  88. virtual const char* GetIDEVersion() { return "10.0"; }
  89. std::string const& GetMSBuildCommand();
  90. std::string GeneratorToolset;
  91. std::string DefaultPlatformToolset;
  92. std::string SystemName;
  93. std::string SystemVersion;
  94. std::string NsightTegraVersion;
  95. bool SystemIsWindowsCE;
  96. bool SystemIsWindowsPhone;
  97. bool SystemIsWindowsStore;
  98. bool ExpressEdition;
  99. bool UseFolderProperty();
  100. private:
  101. class Factory;
  102. struct LongestSourcePath
  103. {
  104. LongestSourcePath(): Length(0), Target(0), SourceFile(0) {}
  105. size_t Length;
  106. cmTarget* Target;
  107. cmSourceFile const* SourceFile;
  108. std::string SourceRel;
  109. };
  110. LongestSourcePath LongestSource;
  111. std::string MSBuildCommand;
  112. bool MSBuildCommandInitialized;
  113. virtual std::string FindMSBuildCommand();
  114. virtual std::string FindDevEnvCommand();
  115. virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); }
  116. // We do not use the reload macros for VS >= 10.
  117. virtual std::string GetUserMacrosDirectory() { return ""; }
  118. };
  119. #endif