Imported Upstream version 2.8.9
[platform/upstream/cmake.git] / Source / cmGlobalVisualStudio6Generator.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 cmGlobalVisualStudio6Generator_h
13 #define cmGlobalVisualStudio6Generator_h
14
15 #include "cmGlobalVisualStudioGenerator.h"
16
17 class cmTarget;
18
19 /** \class cmGlobalVisualStudio6Generator
20  * \brief Write a Unix makefiles.
21  *
22  * cmGlobalVisualStudio6Generator manages UNIX build process for a tree
23  */
24 class cmGlobalVisualStudio6Generator : public cmGlobalVisualStudioGenerator
25 {
26 public:
27   cmGlobalVisualStudio6Generator();
28   static cmGlobalGenerator* New() { 
29     return new cmGlobalVisualStudio6Generator; }
30   
31   ///! Get the name for the generator.
32   virtual const char* GetName() const {
33     return cmGlobalVisualStudio6Generator::GetActualName();}
34   static const char* GetActualName() {return "Visual Studio 6";}
35
36   /** Get the documentation entry for this generator.  */
37   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
38   
39   ///! Create a local generator appropriate to this Global Generator
40   virtual cmLocalGenerator *CreateLocalGenerator();
41
42   /**
43    * Try to determine system infomation such as shared library
44    * extension, pthreads, byte order etc.  
45    */
46   virtual void EnableLanguage(std::vector<std::string>const& languages, 
47                               cmMakefile *, bool optional);
48
49   /**
50    * Try running cmake and building a file. This is used for dynalically
51    * loaded commands, not as part of the usual build process.
52    */
53   virtual std::string GenerateBuildCommand(const char* makeProgram,
54                                            const char *projectName,
55                                            const char* additionalOptions, 
56                                            const char *targetName, 
57                                            const char* config,
58                                            bool ignoreErrors,
59                                            bool fast);
60
61   /**
62    * Generate the all required files for building this project/tree. This
63    * basically creates a series of LocalGenerators for each directory and
64    * requests that they Generate.  
65    */
66   virtual void Generate();
67
68   /**
69    * Generate the DSW workspace file.
70    */
71   virtual void OutputDSWFile();
72   virtual void OutputDSWFile(cmLocalGenerator* root,
73                              std::vector<cmLocalGenerator*>& generators);
74   virtual void WriteDSWFile(std::ostream& fout,
75                             cmLocalGenerator* root,
76                             std::vector<cmLocalGenerator*>& generators);
77
78   /** Append the subdirectory for the given configuration.  */
79   virtual void AppendDirectoryForConfig(const char* prefix,
80                                         const char* config,
81                                         const char* suffix,
82                                         std::string& dir);
83
84   ///! What is the configurations directory variable called?
85   virtual const char* GetCMakeCFGIntDir() const { return "$(IntDir)"; }
86
87 protected:
88   virtual const char* GetIDEVersion() { return "6.0"; }
89 private:
90   void GenerateConfigurations(cmMakefile* mf);
91   void WriteDSWFile(std::ostream& fout);
92   void WriteDSWHeader(std::ostream& fout);
93   void WriteProject(std::ostream& fout, 
94                     const char* name, const char* path, cmTarget &t);
95   void WriteExternalProject(std::ostream& fout, 
96                             const char* name, const char* path,
97                             const std::set<cmStdString>& dependencies);
98   void WriteDSWFooter(std::ostream& fout);
99   virtual std::string WriteUtilityDepend(cmTarget* target);
100 };
101
102 #endif