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. */
44 cmLocalVisualStudioGenerator(VSVersion v);
45 virtual ~cmLocalVisualStudioGenerator();
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");
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;
56 /** Version of Visual Studio. */
57 VSVersion GetVersion() const { return this->Version; }
59 virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
61 virtual void AddCMakeListsRules() = 0;
64 virtual const char* ReportErrorLabel() const;
65 virtual bool CustomCommandUseLocal() const { return false; }
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);