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