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