Imported Upstream version 2.8.9
[platform/upstream/cmake.git] / Source / cmGlobalVisualStudio10Generator.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12 #ifndef cmGlobalVisualStudio10Generator_h
13 #define cmGlobalVisualStudio10Generator_h
14
15 #include "cmGlobalVisualStudio8Generator.h"
16
17
18 /** \class cmGlobalVisualStudio10Generator
19  * \brief Write a Unix makefiles.
20  *
21  * cmGlobalVisualStudio10Generator manages UNIX build process for a tree
22  */
23 class cmGlobalVisualStudio10Generator : 
24   public cmGlobalVisualStudio8Generator
25 {
26 public:
27   cmGlobalVisualStudio10Generator();
28   static cmGlobalGenerator* New() { 
29     return new cmGlobalVisualStudio10Generator; }
30   
31   virtual std::string 
32   GenerateBuildCommand(const char* makeProgram,
33                        const char *projectName, 
34                        const char* additionalOptions, const char *targetName,
35                        const char* config, bool ignoreErrors, bool);
36   
37   ///! Get the name for the generator.
38   virtual const char* GetName() const {
39     return cmGlobalVisualStudio10Generator::GetActualName();}
40   static const char* GetActualName() {return "Visual Studio 10";}
41   virtual void AddPlatformDefinitions(cmMakefile* mf);
42   
43   /** Get the documentation entry for this generator.  */
44   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
45
46   ///! create the correct local generator
47   virtual cmLocalGenerator *CreateLocalGenerator();
48
49   virtual void Generate();
50
51   /**
52    * Try to determine system infomation such as shared library
53    * extension, pthreads, byte order etc.  
54    */
55   virtual void EnableLanguage(std::vector<std::string>const& languages, 
56                               cmMakefile *, bool optional);
57   virtual void WriteSLNHeader(std::ostream& fout);
58
59   /** Is the installed VS an Express edition?  */
60   bool IsExpressEdition() const { return this->ExpressEdition; }
61
62   /** The toolset name for the target platform.  */
63   const char* GetPlatformToolset();
64
65   /**
66    * Where does this version of Visual Studio look for macros for the
67    * current user? Returns the empty string if this version of Visual
68    * Studio does not implement support for VB macros.
69    */
70   virtual std::string GetUserMacrosDirectory();
71
72   /**
73    * What is the reg key path to "vsmacros" for this version of Visual
74    * Studio?
75    */
76   virtual std::string GetUserMacrosRegKeyBase();
77   virtual const char* GetCMakeCFGIntDir() const
78     { return "$(Configuration)";}
79   bool Find64BitTools(cmMakefile* mf);
80
81   /** Generate an <output>.rule file path for a given command output.  */
82   virtual std::string GenerateRuleFile(std::string const& output) const;
83
84   void PathTooLong(cmTarget* target, cmSourceFile* sf,
85                    std::string const& sfRel);
86 protected:
87   virtual const char* GetIDEVersion() { return "10.0"; }
88
89   std::string PlatformToolset;
90   bool ExpressEdition;
91
92   bool UseFolderProperty();
93
94 private:
95   struct LongestSourcePath
96   {
97     LongestSourcePath(): Length(0), Target(0), SourceFile(0) {}
98     size_t Length;
99     cmTarget* Target;
100     cmSourceFile* SourceFile;
101     std::string SourceRel;
102   };
103   LongestSourcePath LongestSource;
104 };
105 #endif