cmGlobalVisualStudio10Generator.h 3.3 KB

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