packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmLocalVisualStudioGenerator.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 cmLocalVisualStudioGenerator_h
13 #define cmLocalVisualStudioGenerator_h
14
15 #include "cmLocalGenerator.h"
16
17 #include <cmsys/auto_ptr.hxx>
18
19 class cmSourceFile;
20 class cmSourceGroup;
21 class cmCustomCommand;
22
23 /** \class cmLocalVisualStudioGenerator
24  * \brief Base class for Visual Studio generators.
25  *
26  * cmLocalVisualStudioGenerator provides functionality common to all
27  * Visual Studio generators.
28  */
29 class cmLocalVisualStudioGenerator : public cmLocalGenerator
30 {
31 public:
32   /** Known versions of Visual Studio.  */
33   enum VSVersion
34   {
35     VS6 = 60,
36     VS7 = 70,
37     VS71 = 71,
38     VS8 = 80,
39     VS9 = 90,
40     VS10 = 100,
41     VS11 = 110,
42     VS12 = 120
43   };
44
45   cmLocalVisualStudioGenerator(VSVersion v);
46   virtual ~cmLocalVisualStudioGenerator();
47
48   /** Construct a script from the given list of command lines.  */
49   std::string ConstructScript(cmCustomCommand const& cc,
50                               const char* configName,
51                               const char* newline = "\n");
52
53   /** Label to which to jump in a batch file after a failed step in a
54       sequence of custom commands. */
55   const char* GetReportErrorLabel() const;
56
57   /** Version of Visual Studio.  */
58   VSVersion GetVersion() const { return this->Version; }
59
60   virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
61
62   virtual void AddCMakeListsRules() = 0;
63
64 protected:
65   virtual const char* ReportErrorLabel() const;
66   virtual bool CustomCommandUseLocal() const { return false; }
67
68   /** Construct a custom command to make exe import lib dir.  */
69   cmsys::auto_ptr<cmCustomCommand>
70   MaybeCreateImplibDir(cmTarget& target, const char* config, bool isFortran);
71
72   VSVersion Version;
73 };
74
75 #endif