2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2007-04-04 19:22:14 +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.
|
2007-04-04 19:22:14 +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.
|
|
|
|
============================================================================*/
|
2007-04-04 19:22:14 +04:00
|
|
|
#ifndef cmGlobalVisualStudioGenerator_h
|
|
|
|
#define cmGlobalVisualStudioGenerator_h
|
|
|
|
|
|
|
|
#include "cmGlobalGenerator.h"
|
|
|
|
|
|
|
|
/** \class cmGlobalVisualStudioGenerator
|
|
|
|
* \brief Base class for global Visual Studio generators.
|
|
|
|
*
|
|
|
|
* cmGlobalVisualStudioGenerator provides functionality common to all
|
|
|
|
* global Visual Studio generators.
|
|
|
|
*/
|
|
|
|
class cmGlobalVisualStudioGenerator : public cmGlobalGenerator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmGlobalVisualStudioGenerator();
|
|
|
|
virtual ~cmGlobalVisualStudioGenerator();
|
2007-04-04 22:50:35 +04:00
|
|
|
|
2007-04-10 21:09:03 +04:00
|
|
|
/**
|
|
|
|
* Basic generate implementation for all VS generators.
|
|
|
|
*/
|
|
|
|
virtual void Generate();
|
|
|
|
|
2007-11-16 15:01:58 +03:00
|
|
|
/**
|
|
|
|
* Configure CMake's Visual Studio macros file into the user's Visual
|
|
|
|
* Studio macros directory.
|
|
|
|
*/
|
|
|
|
virtual void ConfigureCMakeVisualStudioMacros();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Where does this version of Visual Studio look for macros for the
|
|
|
|
* current user? Returns the empty string if this version of Visual
|
|
|
|
* Studio does not implement support for VB macros.
|
|
|
|
*/
|
|
|
|
virtual std::string GetUserMacrosDirectory();
|
|
|
|
|
2008-02-15 19:49:58 +03:00
|
|
|
/**
|
|
|
|
* What is the reg key path to "vsmacros" for this version of Visual
|
|
|
|
* Studio?
|
|
|
|
*/
|
|
|
|
virtual std::string GetUserMacrosRegKeyBase();
|
|
|
|
|
2007-11-19 21:44:51 +03:00
|
|
|
enum MacroName {MacroReload, MacroStop};
|
|
|
|
|
2007-11-16 15:01:58 +03:00
|
|
|
/**
|
|
|
|
* Call the ReloadProjects macro if necessary based on
|
|
|
|
* GetFilesReplacedDuringGenerate results.
|
|
|
|
*/
|
2007-11-19 21:44:51 +03:00
|
|
|
virtual void CallVisualStudioMacro(MacroName m,
|
|
|
|
const char* vsSolutionFile = 0);
|
2008-04-30 21:26:04 +04:00
|
|
|
|
|
|
|
// return true if target is fortran only
|
|
|
|
bool TargetIsFortranOnly(cmTarget& t);
|
2009-07-14 22:16:46 +04:00
|
|
|
const char* GetUtilityForTarget(cmTarget& target, const char*);
|
2007-11-16 15:01:58 +03:00
|
|
|
|
2009-09-16 19:44:08 +04:00
|
|
|
/** Get the top-level registry key for this VS version. */
|
|
|
|
std::string GetRegistryBase();
|
2007-04-04 22:50:35 +04:00
|
|
|
protected:
|
2007-12-21 23:04:06 +03:00
|
|
|
void FixUtilityDepends();
|
2007-11-16 15:01:58 +03:00
|
|
|
|
2007-12-21 23:04:06 +03:00
|
|
|
// Does this VS version link targets to each other if there are
|
|
|
|
// dependencies in the SLN file? This was done for VS versions
|
|
|
|
// below 8.
|
|
|
|
virtual bool VSLinksDependencies() const { return true; }
|
|
|
|
|
2009-09-16 19:44:08 +04:00
|
|
|
virtual const char* GetIDEVersion() = 0;
|
2009-10-01 00:02:58 +04:00
|
|
|
|
|
|
|
struct TargetCompare
|
|
|
|
{
|
|
|
|
bool operator()(cmTarget const* l, cmTarget const* r) const;
|
|
|
|
};
|
|
|
|
class OrderedTargetDependSet: public std::multiset<cmTarget*, TargetCompare>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
|
|
|
|
};
|
|
|
|
|
2009-10-01 18:27:02 +04:00
|
|
|
virtual void GetTargetSets(TargetDependSet& projectTargets,
|
|
|
|
TargetDependSet& originalTargets,
|
|
|
|
cmLocalGenerator* root, GeneratorVector const&);
|
2009-10-21 00:38:37 +04:00
|
|
|
|
|
|
|
bool CheckTargetLinks(cmTarget& target, const char* name);
|
2007-04-04 22:50:35 +04:00
|
|
|
private:
|
|
|
|
void FixUtilityDependsForTarget(cmTarget& target);
|
|
|
|
void CreateUtilityDependTarget(cmTarget& target);
|
2007-04-04 19:22:14 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|