1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
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
15 #include "cmLocalGenerator.h"
17 #include <cmsys/auto_ptr.hxx>
21 class cmCustomCommand;
23 /** \class cmLocalVisualStudioGenerator
24 * \brief Base class for Visual Studio generators.
26 * cmLocalVisualStudioGenerator provides functionality common to all
27 * Visual Studio generators.
29 class cmLocalVisualStudioGenerator : public cmLocalGenerator
32 /** Known versions of Visual Studio. */
45 cmLocalVisualStudioGenerator(VSVersion v);
46 virtual ~cmLocalVisualStudioGenerator();
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");
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;
57 /** Version of Visual Studio. */
58 VSVersion GetVersion() const { return this->Version; }
60 virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
62 virtual void AddCMakeListsRules() = 0;
65 virtual const char* ReportErrorLabel() const;
66 virtual bool CustomCommandUseLocal() const { return false; }
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);