cmGlobalVisualStudio10Generator.h 3.2 KB

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