2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2006-07-11 19:41:38 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2006-07-11 19:41:38 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2006-07-11 19:41:38 +04:00
|
|
|
#ifndef cmLocalVisualStudioGenerator_h
|
|
|
|
#define cmLocalVisualStudioGenerator_h
|
|
|
|
|
|
|
|
#include "cmLocalGenerator.h"
|
|
|
|
|
2009-06-16 19:44:07 +04:00
|
|
|
#include <cmsys/auto_ptr.hxx>
|
|
|
|
|
2006-07-11 19:41:38 +04:00
|
|
|
class cmSourceFile;
|
|
|
|
class cmSourceGroup;
|
2010-12-07 21:44:54 +03:00
|
|
|
class cmCustomCommand;
|
2006-07-11 19:41:38 +04:00
|
|
|
|
|
|
|
/** \class cmLocalVisualStudioGenerator
|
|
|
|
* \brief Base class for Visual Studio generators.
|
|
|
|
*
|
|
|
|
* cmLocalVisualStudioGenerator provides functionality common to all
|
|
|
|
* Visual Studio generators.
|
|
|
|
*/
|
|
|
|
class cmLocalVisualStudioGenerator : public cmLocalGenerator
|
|
|
|
{
|
|
|
|
public:
|
2011-11-11 02:17:41 +04:00
|
|
|
/** Known versions of Visual Studio. */
|
|
|
|
enum VSVersion
|
|
|
|
{
|
|
|
|
VS6 = 60,
|
|
|
|
VS7 = 70,
|
|
|
|
VS71 = 71,
|
|
|
|
VS8 = 80,
|
|
|
|
VS9 = 90,
|
2011-11-14 18:42:51 +04:00
|
|
|
VS10 = 100,
|
|
|
|
VS11 = 110
|
2011-11-11 02:17:41 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
cmLocalVisualStudioGenerator(VSVersion v);
|
2006-07-11 19:41:38 +04:00
|
|
|
virtual ~cmLocalVisualStudioGenerator();
|
2010-12-17 19:11:55 +03:00
|
|
|
|
2006-09-21 23:14:06 +04:00
|
|
|
/** Construct a script from the given list of command lines. */
|
2010-12-07 21:44:54 +03:00
|
|
|
std::string ConstructScript(cmCustomCommand const& cc,
|
2007-05-09 16:25:45 +04:00
|
|
|
const char* configName,
|
2006-09-21 23:14:06 +04:00
|
|
|
const char* newline = "\n");
|
|
|
|
|
2011-04-08 18:40:57 +04:00
|
|
|
/** Label to which to jump in a batch file after a failed step in a
|
|
|
|
sequence of custom commands. */
|
|
|
|
const char* GetReportErrorLabel() const;
|
2010-12-17 19:11:55 +03:00
|
|
|
|
2011-11-11 02:17:41 +04:00
|
|
|
/** Version of Visual Studio. */
|
|
|
|
VSVersion GetVersion() const { return this->Version; }
|
|
|
|
|
2009-06-26 00:41:57 +04:00
|
|
|
protected:
|
2011-04-08 18:40:57 +04:00
|
|
|
virtual const char* ReportErrorLabel() const;
|
2011-04-11 18:07:40 +04:00
|
|
|
virtual bool CustomCommandUseLocal() const { return false; }
|
2009-06-26 00:41:57 +04:00
|
|
|
|
|
|
|
/** Construct a custom command to make exe import lib dir. */
|
|
|
|
cmsys::auto_ptr<cmCustomCommand>
|
2011-02-11 00:17:44 +03:00
|
|
|
MaybeCreateImplibDir(cmTarget& target, const char* config, bool isFortran);
|
2009-06-26 00:41:57 +04:00
|
|
|
|
2006-07-11 19:41:38 +04:00
|
|
|
// Safe object file name generation.
|
|
|
|
void ComputeObjectNameRequirements(std::vector<cmSourceGroup> const&);
|
2006-08-01 18:48:40 +04:00
|
|
|
bool SourceFileCompiles(const cmSourceFile* sf);
|
2007-08-28 01:05:43 +04:00
|
|
|
void CountObjectNames(const std::vector<cmSourceGroup>& groups,
|
|
|
|
std::map<cmStdString, int>& count);
|
|
|
|
void InsertNeedObjectNames(const std::vector<cmSourceGroup>& groups,
|
|
|
|
std::map<cmStdString, int>& count);
|
2006-07-11 19:41:38 +04:00
|
|
|
std::set<const cmSourceFile*> NeedObjectName;
|
2009-07-10 17:12:39 +04:00
|
|
|
friend class cmVisualStudio10TargetGenerator;
|
2011-11-11 02:17:41 +04:00
|
|
|
|
|
|
|
VSVersion Version;
|
2006-07-11 19:41:38 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|