Imported Upstream version 2.8.9
[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   };
43
44   cmLocalVisualStudioGenerator(VSVersion v);
45   virtual ~cmLocalVisualStudioGenerator();
46
47   /** Construct a script from the given list of command lines.  */
48   std::string ConstructScript(cmCustomCommand const& cc,
49                               const char* configName,
50                               const char* newline = "\n");
51
52   /** Label to which to jump in a batch file after a failed step in a
53       sequence of custom commands. */
54   const char* GetReportErrorLabel() const;
55
56   /** Version of Visual Studio.  */
57   VSVersion GetVersion() const { return this->Version; }
58
59   virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
60
61   virtual void AddCMakeListsRules() = 0;
62
63 protected:
64   virtual const char* ReportErrorLabel() const;
65   virtual bool CustomCommandUseLocal() const { return false; }
66
67   /** Construct a custom command to make exe import lib dir.  */
68   cmsys::auto_ptr<cmCustomCommand>
69   MaybeCreateImplibDir(cmTarget& target, const char* config, bool isFortran);
70
71   VSVersion Version;
72 };
73
74 #endif