cmGlobalVisualStudio10Generator.h 3.5 KB

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