VS: Move version information to global generator.
This commit is contained in:
parent
b5f093f096
commit
e435f875ec
|
@ -105,6 +105,7 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
|
|||
this->SystemIsWindowsPhone = false;
|
||||
this->SystemIsWindowsStore = false;
|
||||
this->MSBuildCommandInitialized = false;
|
||||
this->Version = VS10;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -311,8 +312,7 @@ void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
|
|||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio10Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
return new cmLocalVisualStudio10Generator(
|
||||
cmLocalVisualStudioGenerator::VS10, this, parent);
|
||||
return new cmLocalVisualStudio10Generator(this, parent);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -117,6 +117,7 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
|
|||
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0\\Setup\\VC;"
|
||||
"ProductDir", vc11Express, cmSystemTools::KeyWOW64_32);
|
||||
this->DefaultPlatformToolset = "v110";
|
||||
this->Version = VS11;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -240,8 +241,7 @@ void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout)
|
|||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio11Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
return new cmLocalVisualStudio10Generator(
|
||||
cmLocalVisualStudioGenerator::VS11, this, parent);
|
||||
return new cmLocalVisualStudio10Generator(this, parent);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -97,6 +97,7 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
|
|||
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\12.0\\Setup\\VC;"
|
||||
"ProductDir", vc12Express, cmSystemTools::KeyWOW64_32);
|
||||
this->DefaultPlatformToolset = "v120";
|
||||
this->Version = VS12;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -220,8 +221,7 @@ void cmGlobalVisualStudio12Generator::WriteSLNHeader(std::ostream& fout)
|
|||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio12Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
return new cmLocalVisualStudio10Generator(
|
||||
cmLocalVisualStudioGenerator::VS12, this, parent);
|
||||
return new cmLocalVisualStudio10Generator(this, parent);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -97,6 +97,7 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator(
|
|||
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\14.0\\Setup\\VC;"
|
||||
"ProductDir", vc14Express, cmSystemTools::KeyWOW64_32);
|
||||
this->DefaultPlatformToolset = "v140";
|
||||
this->Version = VS14;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -131,6 +132,5 @@ void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout)
|
|||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio14Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
return new cmLocalVisualStudio10Generator(
|
||||
cmLocalVisualStudioGenerator::VS14, this, parent);
|
||||
return new cmLocalVisualStudio10Generator(this, parent);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ std::string GetVS6TargetName(const std::string& targetName)
|
|||
cmGlobalVisualStudio6Generator::cmGlobalVisualStudio6Generator()
|
||||
{
|
||||
this->MSDevCommandInitialized = false;
|
||||
this->Version = VS6;
|
||||
}
|
||||
|
||||
void cmGlobalVisualStudio6Generator
|
||||
|
|
|
@ -21,6 +21,7 @@ cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(
|
|||
: cmGlobalVisualStudio7Generator(platformName)
|
||||
{
|
||||
this->ProjectConfigurationSectionName = "ProjectConfiguration";
|
||||
this->Version = VS71;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -29,8 +30,7 @@ cmLocalGenerator *
|
|||
cmGlobalVisualStudio71Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio7Generator *lg =
|
||||
new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS71,
|
||||
this, parent);
|
||||
new cmLocalVisualStudio7Generator(this, parent);
|
||||
return lg;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
|
|||
this->DefaultPlatformName = platformName;
|
||||
}
|
||||
this->ExtraFlagTable = cmVS7ExtraFlagTable;
|
||||
this->Version = VS7;
|
||||
}
|
||||
|
||||
cmGlobalVisualStudio7Generator::~cmGlobalVisualStudio7Generator()
|
||||
|
@ -281,8 +282,7 @@ cmLocalGenerator *
|
|||
cmGlobalVisualStudio7Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio7Generator *lg =
|
||||
new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS7,
|
||||
this, parent);
|
||||
new cmLocalVisualStudio7Generator(this, parent);
|
||||
return lg;
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
|
|||
this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
|
||||
this->Name = name;
|
||||
this->ExtraFlagTable = this->GetExtraFlagTableVS8();
|
||||
this->Version = VS8;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -130,8 +131,7 @@ cmLocalGenerator *
|
|||
cmGlobalVisualStudio8Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio7Generator *lg =
|
||||
new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS8,
|
||||
this, parent);
|
||||
new cmLocalVisualStudio7Generator(this, parent);
|
||||
return lg;
|
||||
}
|
||||
|
||||
|
|
|
@ -104,6 +104,7 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator(
|
|||
const std::string& name, const std::string& platformName)
|
||||
: cmGlobalVisualStudio8Generator(name, platformName)
|
||||
{
|
||||
this->Version = VS9;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -118,8 +119,7 @@ cmLocalGenerator *
|
|||
cmGlobalVisualStudio9Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio7Generator *lg
|
||||
= new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS9,
|
||||
this, parent);
|
||||
= new cmLocalVisualStudio7Generator(this, parent);
|
||||
return lg;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,19 @@ cmGlobalVisualStudioGenerator::~cmGlobalVisualStudioGenerator()
|
|||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmGlobalVisualStudioGenerator::VSVersion
|
||||
cmGlobalVisualStudioGenerator::GetVersion() const
|
||||
{
|
||||
return this->Version;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmGlobalVisualStudioGenerator::SetVersion(VSVersion v)
|
||||
{
|
||||
this->Version = v;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string cmGlobalVisualStudioGenerator::GetRegistryBase()
|
||||
{
|
||||
|
|
|
@ -23,9 +23,27 @@
|
|||
class cmGlobalVisualStudioGenerator : public cmGlobalGenerator
|
||||
{
|
||||
public:
|
||||
/** Known versions of Visual Studio. */
|
||||
enum VSVersion
|
||||
{
|
||||
VS6 = 60,
|
||||
VS7 = 70,
|
||||
VS71 = 71,
|
||||
VS8 = 80,
|
||||
VS9 = 90,
|
||||
VS10 = 100,
|
||||
VS11 = 110,
|
||||
VS12 = 120,
|
||||
/* VS13 = 130 was skipped */
|
||||
VS14 = 140
|
||||
};
|
||||
|
||||
cmGlobalVisualStudioGenerator();
|
||||
virtual ~cmGlobalVisualStudioGenerator();
|
||||
|
||||
VSVersion GetVersion() const;
|
||||
void SetVersion(VSVersion v);
|
||||
|
||||
/**
|
||||
* Configure CMake's Visual Studio macros file into the user's Visual
|
||||
* Studio macros directory.
|
||||
|
@ -107,6 +125,9 @@ protected:
|
|||
typedef std::map<cmTarget const*, std::string> UtilityDependsMap;
|
||||
UtilityDependsMap UtilityDepends;
|
||||
|
||||
protected:
|
||||
VSVersion Version;
|
||||
|
||||
private:
|
||||
virtual std::string GetVSMakeProgram() = 0;
|
||||
void PrintCompilerAdvice(std::ostream&, std::string const&,
|
||||
|
|
|
@ -62,9 +62,9 @@ class cmVS10XMLParser : public cmXMLParser
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalVisualStudio10Generator
|
||||
::cmLocalVisualStudio10Generator(VSVersion v, cmGlobalGenerator* gg,
|
||||
::cmLocalVisualStudio10Generator(cmGlobalGenerator* gg,
|
||||
cmLocalGenerator* parent):
|
||||
cmLocalVisualStudio7Generator(v, gg, parent)
|
||||
cmLocalVisualStudio7Generator(gg, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class cmLocalVisualStudio10Generator : public cmLocalVisualStudio7Generator
|
|||
{
|
||||
public:
|
||||
///! Set cache only and recurse to false by default.
|
||||
cmLocalVisualStudio10Generator(VSVersion v, cmGlobalGenerator* gg,
|
||||
cmLocalVisualStudio10Generator(cmGlobalGenerator* gg,
|
||||
cmLocalGenerator* parent);
|
||||
|
||||
virtual ~cmLocalVisualStudio10Generator();
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
cmLocalVisualStudio6Generator
|
||||
::cmLocalVisualStudio6Generator(cmGlobalGenerator* gg,
|
||||
cmLocalGenerator* parent):
|
||||
cmLocalVisualStudioGenerator(VS6, gg, parent)
|
||||
cmLocalVisualStudioGenerator(gg, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -55,9 +55,9 @@ static void cmConvertToWindowsSlash(std::string& s)
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalVisualStudio7Generator
|
||||
::cmLocalVisualStudio7Generator(VSVersion v, cmGlobalGenerator* gg,
|
||||
::cmLocalVisualStudio7Generator(cmGlobalGenerator* gg,
|
||||
cmLocalGenerator* parent):
|
||||
cmLocalVisualStudioGenerator(v, gg, parent)
|
||||
cmLocalVisualStudioGenerator(gg, parent)
|
||||
{
|
||||
this->Internal = new cmLocalVisualStudio7GeneratorInternals(this);
|
||||
}
|
||||
|
@ -240,18 +240,17 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
|
|||
void cmLocalVisualStudio7Generator
|
||||
::CreateSingleVCProj(const std::string& lname, cmTarget &target)
|
||||
{
|
||||
this->FortranProject =
|
||||
static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
|
||||
->TargetIsFortranOnly(target);
|
||||
this->WindowsCEProject =
|
||||
static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
|
||||
->TargetsWindowsCE();
|
||||
cmGlobalVisualStudioGenerator* gg
|
||||
= static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator);
|
||||
this->FortranProject = gg->TargetIsFortranOnly(target);
|
||||
this->WindowsCEProject = gg->TargetsWindowsCE();
|
||||
|
||||
// Intel Fortran for VS10 uses VS9 format ".vfproj" files.
|
||||
VSVersion realVersion = this->Version;
|
||||
if(this->FortranProject && this->Version >= VS10)
|
||||
cmGlobalVisualStudioGenerator::VSVersion realVersion = gg->GetVersion();
|
||||
if(this->FortranProject
|
||||
&& gg->GetVersion() >= cmGlobalVisualStudioGenerator::VS10)
|
||||
{
|
||||
this->Version = VS9;
|
||||
gg->SetVersion(cmGlobalVisualStudioGenerator::VS9);
|
||||
}
|
||||
|
||||
// add to the list of projects
|
||||
|
@ -281,7 +280,7 @@ void cmLocalVisualStudio7Generator
|
|||
this->GlobalGenerator->FileReplacedDuringGenerate(fname);
|
||||
}
|
||||
|
||||
this->Version = realVersion;
|
||||
gg->SetVersion(realVersion);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -994,7 +993,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
|||
// end of <Tool Name=VCMIDLTool
|
||||
|
||||
// Check if we need the FAT32 workaround.
|
||||
if(targetBuilds && this->Version >= VS8)
|
||||
if(targetBuilds && this->GetVersion() >= cmGlobalVisualStudioGenerator::VS8)
|
||||
{
|
||||
// Check the filesystem type where the target will be written.
|
||||
if(cmLVS6G_IsFAT(target.GetDirectory(configName).c_str()))
|
||||
|
@ -1129,7 +1128,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
|||
fout << "\t\t\t<Tool\n"
|
||||
<< "\t\t\t\tName=\"" << tool << "\"\n";
|
||||
|
||||
if(this->GetVersion() < VS8 || this->FortranProject)
|
||||
if(this->GetVersion() < cmGlobalVisualStudioGenerator::VS8
|
||||
|| this->FortranProject)
|
||||
{
|
||||
std::ostringstream libdeps;
|
||||
this->Internal->OutputObjects(libdeps, &target);
|
||||
|
@ -1189,7 +1189,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
|||
// libraries which may be set by the user to something bad.
|
||||
fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) "
|
||||
<< this->Makefile->GetSafeDefinition(standardLibsVar.c_str());
|
||||
if(this->GetVersion() < VS8 || this->FortranProject)
|
||||
if(this->GetVersion() < cmGlobalVisualStudioGenerator::VS8
|
||||
|| this->FortranProject)
|
||||
{
|
||||
this->Internal->OutputObjects(fout, &target, " ");
|
||||
}
|
||||
|
@ -1217,7 +1218,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
|||
}
|
||||
if(this->WindowsCEProject)
|
||||
{
|
||||
if(this->GetVersion() < VS9)
|
||||
if(this->GetVersion() < cmGlobalVisualStudioGenerator::VS9)
|
||||
{
|
||||
fout << "\t\t\t\tSubSystem=\"9\"\n";
|
||||
}
|
||||
|
@ -1287,7 +1288,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
|||
// libraries which may be set by the user to something bad.
|
||||
fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) "
|
||||
<< this->Makefile->GetSafeDefinition(standardLibsVar.c_str());
|
||||
if(this->GetVersion() < VS8 || this->FortranProject)
|
||||
if(this->GetVersion() < cmGlobalVisualStudioGenerator::VS8
|
||||
|| this->FortranProject)
|
||||
{
|
||||
this->Internal->OutputObjects(fout, &target, " ");
|
||||
}
|
||||
|
@ -1315,7 +1317,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
|||
}
|
||||
if ( this->WindowsCEProject )
|
||||
{
|
||||
if(this->GetVersion() < VS9)
|
||||
if(this->GetVersion() < cmGlobalVisualStudioGenerator::VS9)
|
||||
{
|
||||
fout << "\t\t\t\tSubSystem=\"9\"\n";
|
||||
}
|
||||
|
@ -1516,7 +1518,8 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
|
|||
this->WriteGroup(&sg, target, fout, libName, configs);
|
||||
}
|
||||
|
||||
if(this->GetVersion() >= VS8 && !this->FortranProject)
|
||||
if(this->GetVersion() >= cmGlobalVisualStudioGenerator::VS8
|
||||
&& !this->FortranProject)
|
||||
{
|
||||
// VS >= 8 support per-config source locations so we
|
||||
// list object library content as external objects.
|
||||
|
@ -2148,13 +2151,13 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
|
|||
<< gg->Encoding() << "\"?>\n"
|
||||
<< "<VisualStudioProject\n"
|
||||
<< "\tProjectType=\"Visual C++\"\n";
|
||||
if(this->Version == VS71)
|
||||
if(gg->GetVersion() == cmGlobalVisualStudioGenerator::VS71)
|
||||
{
|
||||
fout << "\tVersion=\"7.10\"\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
fout << "\tVersion=\"" << (this->Version/10) << ".00\"\n";
|
||||
fout << "\tVersion=\"" << (gg->GetVersion()/10) << ".00\"\n";
|
||||
}
|
||||
const char* projLabel = target.GetProperty("PROJECT_LABEL");
|
||||
if(!projLabel)
|
||||
|
@ -2167,7 +2170,7 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
|
|||
keyword = "Win32Proj";
|
||||
}
|
||||
fout << "\tName=\"" << projLabel << "\"\n";
|
||||
if(this->Version >= VS8)
|
||||
if(gg->GetVersion() >= cmGlobalVisualStudioGenerator::VS8)
|
||||
{
|
||||
fout << "\tProjectGUID=\"{" << gg->GetGUID(libName.c_str()) << "}\"\n";
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class cmLocalVisualStudio7Generator : public cmLocalVisualStudioGenerator
|
|||
{
|
||||
public:
|
||||
///! Set cache only and recurse to false by default.
|
||||
cmLocalVisualStudio7Generator(VSVersion v, cmGlobalGenerator* gg,
|
||||
cmLocalVisualStudio7Generator(cmGlobalGenerator* gg,
|
||||
cmLocalGenerator* parent);
|
||||
|
||||
virtual ~cmLocalVisualStudio7Generator();
|
||||
|
|
|
@ -19,11 +19,10 @@
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalVisualStudioGenerator
|
||||
::cmLocalVisualStudioGenerator(VSVersion v, cmGlobalGenerator* gg,
|
||||
::cmLocalVisualStudioGenerator(cmGlobalGenerator* gg,
|
||||
cmLocalGenerator* parent)
|
||||
: cmLocalGenerator(gg, parent)
|
||||
{
|
||||
this->Version = v;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -31,6 +30,15 @@ cmLocalVisualStudioGenerator::~cmLocalVisualStudioGenerator()
|
|||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmGlobalVisualStudioGenerator::VSVersion
|
||||
cmLocalVisualStudioGenerator::GetVersion() const
|
||||
{
|
||||
cmGlobalVisualStudioGenerator* gg =
|
||||
static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator);
|
||||
return gg->GetVersion();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
|
||||
std::map<cmSourceFile const*, std::string>& mapping,
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#define cmLocalVisualStudioGenerator_h
|
||||
|
||||
#include "cmLocalGenerator.h"
|
||||
#include "cmGlobalVisualStudioGenerator.h"
|
||||
|
||||
#include <cmsys/auto_ptr.hxx>
|
||||
|
||||
|
@ -30,22 +31,7 @@ class cmCustomCommandGenerator;
|
|||
class cmLocalVisualStudioGenerator : public cmLocalGenerator
|
||||
{
|
||||
public:
|
||||
/** Known versions of Visual Studio. */
|
||||
enum VSVersion
|
||||
{
|
||||
VS6 = 60,
|
||||
VS7 = 70,
|
||||
VS71 = 71,
|
||||
VS8 = 80,
|
||||
VS9 = 90,
|
||||
VS10 = 100,
|
||||
VS11 = 110,
|
||||
VS12 = 120,
|
||||
/* VS13 = 130 was skipped */
|
||||
VS14 = 140
|
||||
};
|
||||
|
||||
cmLocalVisualStudioGenerator(VSVersion v, cmGlobalGenerator* gg,
|
||||
cmLocalVisualStudioGenerator(cmGlobalGenerator* gg,
|
||||
cmLocalGenerator* parent);
|
||||
virtual ~cmLocalVisualStudioGenerator();
|
||||
|
||||
|
@ -57,8 +43,7 @@ public:
|
|||
sequence of custom commands. */
|
||||
const char* GetReportErrorLabel() const;
|
||||
|
||||
/** Version of Visual Studio. */
|
||||
VSVersion GetVersion() const { return this->Version; }
|
||||
cmGlobalVisualStudioGenerator::VSVersion GetVersion() const;
|
||||
|
||||
virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
|
||||
|
||||
|
@ -76,8 +61,6 @@ protected:
|
|||
cmsys::auto_ptr<cmCustomCommand>
|
||||
MaybeCreateImplibDir(cmTarget& target, const std::string& config,
|
||||
bool isFortran);
|
||||
|
||||
VSVersion Version;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "cmAlgorithms.h"
|
||||
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
# include "cmLocalVisualStudioGenerator.h"
|
||||
# include "cmGlobalVisualStudioGenerator.h"
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
@ -372,13 +372,13 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
|
|||
cmGlobalGenerator* gg = localGen->GetGlobalGenerator();
|
||||
if(gg->GetName().find("Visual Studio") != std::string::npos)
|
||||
{
|
||||
cmLocalVisualStudioGenerator* vslg =
|
||||
static_cast<cmLocalVisualStudioGenerator*>(localGen);
|
||||
cmGlobalVisualStudioGenerator* vsgg =
|
||||
static_cast<cmGlobalVisualStudioGenerator*>(gg);
|
||||
// Under VS >= 7 use a PRE_BUILD event instead of a separate target to
|
||||
// reduce the number of targets loaded into the IDE.
|
||||
// This also works around a VS 11 bug that may skip updating the target:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/769495
|
||||
usePRE_BUILD = vslg->GetVersion() >= cmLocalVisualStudioGenerator::VS7;
|
||||
usePRE_BUILD = vsgg->GetVersion() >= cmGlobalVisualStudioGenerator::VS7;
|
||||
if(usePRE_BUILD)
|
||||
{
|
||||
for (std::vector<std::string>::iterator it = depends.begin();
|
||||
|
|
|
@ -47,13 +47,13 @@ cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetClFlagTable() const
|
|||
{
|
||||
if(this->MSTools)
|
||||
{
|
||||
cmLocalVisualStudioGenerator::VSVersion
|
||||
cmGlobalVisualStudioGenerator::VSVersion
|
||||
v = this->LocalGenerator->GetVersion();
|
||||
if(v >= cmLocalVisualStudioGenerator::VS14)
|
||||
if(v >= cmGlobalVisualStudioGenerator::VS14)
|
||||
{ return cmVS14CLFlagTable; }
|
||||
else if(v >= cmLocalVisualStudioGenerator::VS12)
|
||||
else if(v >= cmGlobalVisualStudioGenerator::VS12)
|
||||
{ return cmVS12CLFlagTable; }
|
||||
else if(v == cmLocalVisualStudioGenerator::VS11)
|
||||
else if(v == cmGlobalVisualStudioGenerator::VS11)
|
||||
{ return cmVS11CLFlagTable; }
|
||||
else
|
||||
{ return cmVS10CLFlagTable; }
|
||||
|
@ -65,13 +65,13 @@ cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetRcFlagTable() const
|
|||
{
|
||||
if(this->MSTools)
|
||||
{
|
||||
cmLocalVisualStudioGenerator::VSVersion
|
||||
cmGlobalVisualStudioGenerator::VSVersion
|
||||
v = this->LocalGenerator->GetVersion();
|
||||
if(v >= cmLocalVisualStudioGenerator::VS14)
|
||||
if(v >= cmGlobalVisualStudioGenerator::VS14)
|
||||
{ return cmVS14RCFlagTable; }
|
||||
else if(v >= cmLocalVisualStudioGenerator::VS12)
|
||||
else if(v >= cmGlobalVisualStudioGenerator::VS12)
|
||||
{ return cmVS12RCFlagTable; }
|
||||
else if(v == cmLocalVisualStudioGenerator::VS11)
|
||||
else if(v == cmGlobalVisualStudioGenerator::VS11)
|
||||
{ return cmVS11RCFlagTable; }
|
||||
else
|
||||
{ return cmVS10RCFlagTable; }
|
||||
|
@ -83,13 +83,13 @@ cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetLibFlagTable() const
|
|||
{
|
||||
if(this->MSTools)
|
||||
{
|
||||
cmLocalVisualStudioGenerator::VSVersion
|
||||
cmGlobalVisualStudioGenerator::VSVersion
|
||||
v = this->LocalGenerator->GetVersion();
|
||||
if(v >= cmLocalVisualStudioGenerator::VS14)
|
||||
if(v >= cmGlobalVisualStudioGenerator::VS14)
|
||||
{ return cmVS14LibFlagTable; }
|
||||
else if(v >= cmLocalVisualStudioGenerator::VS12)
|
||||
else if(v >= cmGlobalVisualStudioGenerator::VS12)
|
||||
{ return cmVS12LibFlagTable; }
|
||||
else if(v == cmLocalVisualStudioGenerator::VS11)
|
||||
else if(v == cmGlobalVisualStudioGenerator::VS11)
|
||||
{ return cmVS11LibFlagTable; }
|
||||
else
|
||||
{ return cmVS10LibFlagTable; }
|
||||
|
@ -101,13 +101,13 @@ cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetLinkFlagTable() const
|
|||
{
|
||||
if(this->MSTools)
|
||||
{
|
||||
cmLocalVisualStudioGenerator::VSVersion
|
||||
cmGlobalVisualStudioGenerator::VSVersion
|
||||
v = this->LocalGenerator->GetVersion();
|
||||
if(v >= cmLocalVisualStudioGenerator::VS14)
|
||||
if(v >= cmGlobalVisualStudioGenerator::VS14)
|
||||
{ return cmVS14LinkFlagTable; }
|
||||
else if(v >= cmLocalVisualStudioGenerator::VS12)
|
||||
else if(v >= cmGlobalVisualStudioGenerator::VS12)
|
||||
{ return cmVS12LinkFlagTable; }
|
||||
else if(v == cmLocalVisualStudioGenerator::VS11)
|
||||
else if(v == cmGlobalVisualStudioGenerator::VS11)
|
||||
{ return cmVS11LinkFlagTable; }
|
||||
else
|
||||
{ return cmVS10LinkFlagTable; }
|
||||
|
@ -119,13 +119,13 @@ cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetMasmFlagTable() const
|
|||
{
|
||||
if(this->MSTools)
|
||||
{
|
||||
cmLocalVisualStudioGenerator::VSVersion
|
||||
cmGlobalVisualStudioGenerator::VSVersion
|
||||
v = this->LocalGenerator->GetVersion();
|
||||
if(v >= cmLocalVisualStudioGenerator::VS14)
|
||||
if(v >= cmGlobalVisualStudioGenerator::VS14)
|
||||
{ return cmVS14MASMFlagTable; }
|
||||
else if(v >= cmLocalVisualStudioGenerator::VS12)
|
||||
else if(v >= cmGlobalVisualStudioGenerator::VS12)
|
||||
{ return cmVS12MASMFlagTable; }
|
||||
else if(v == cmLocalVisualStudioGenerator::VS11)
|
||||
else if(v == cmGlobalVisualStudioGenerator::VS11)
|
||||
{ return cmVS11MASMFlagTable; }
|
||||
else
|
||||
{ return cmVS10MASMFlagTable; }
|
||||
|
@ -911,7 +911,8 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile const* source,
|
|||
sep = ";";
|
||||
}
|
||||
(*this->BuildFileStream ) << "</Outputs>\n";
|
||||
if(this->LocalGenerator->GetVersion() > cmLocalVisualStudioGenerator::VS10)
|
||||
if(this->LocalGenerator->GetVersion()
|
||||
> cmGlobalVisualStudioGenerator::VS10)
|
||||
{
|
||||
// VS >= 11 let us turn off linking of custom command outputs.
|
||||
this->WritePlatformConfigTag("LinkObjects", i->c_str(), 3);
|
||||
|
@ -1416,7 +1417,7 @@ void cmVisualStudio10TargetGenerator::WriteSource(
|
|||
// conversion uses full paths when possible to allow deeper trees.
|
||||
bool forceRelative = false;
|
||||
std::string sourceFile = this->ConvertPath(sf->GetFullPath(), false);
|
||||
if(this->LocalGenerator->GetVersion() == cmLocalVisualStudioGenerator::VS10
|
||||
if(this->LocalGenerator->GetVersion() == cmGlobalVisualStudioGenerator::VS10
|
||||
&& cmSystemTools::FileIsFullPath(sourceFile.c_str()))
|
||||
{
|
||||
// Normal path conversion resulted in a full path. VS 10 (but not 11)
|
||||
|
@ -1544,7 +1545,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
|
|||
++si;
|
||||
}
|
||||
}
|
||||
if(this->LocalGenerator->GetVersion() > cmLocalVisualStudioGenerator::VS10)
|
||||
if(this->LocalGenerator->GetVersion() > cmGlobalVisualStudioGenerator::VS10)
|
||||
{
|
||||
// For VS >= 11 we use LinkObjects to avoid linking custom command
|
||||
// outputs. Use Object for all external objects, generated or not.
|
||||
|
|
|
@ -96,14 +96,14 @@ void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault()
|
|||
// remove the flag we need to override the IDE default of on.
|
||||
switch (this->Version)
|
||||
{
|
||||
case cmLocalVisualStudioGenerator::VS7:
|
||||
case cmLocalVisualStudioGenerator::VS71:
|
||||
case cmGlobalVisualStudioGenerator::VS7:
|
||||
case cmGlobalVisualStudioGenerator::VS71:
|
||||
this->FlagMap["ExceptionHandling"] = "FALSE";
|
||||
break;
|
||||
case cmLocalVisualStudioGenerator::VS10:
|
||||
case cmLocalVisualStudioGenerator::VS11:
|
||||
case cmLocalVisualStudioGenerator::VS12:
|
||||
case cmLocalVisualStudioGenerator::VS14:
|
||||
case cmGlobalVisualStudioGenerator::VS10:
|
||||
case cmGlobalVisualStudioGenerator::VS11:
|
||||
case cmGlobalVisualStudioGenerator::VS12:
|
||||
case cmGlobalVisualStudioGenerator::VS14:
|
||||
// by default VS puts <ExceptionHandling></ExceptionHandling> empty
|
||||
// for a project, to make our projects look the same put a new line
|
||||
// and space over for the closing </ExceptionHandling> as the default
|
||||
|
@ -132,7 +132,7 @@ void cmVisualStudioGeneratorOptions::SetVerboseMakefile(bool verbose)
|
|||
this->FlagMap.find("SuppressStartupBanner") == this->FlagMap.end())
|
||||
{
|
||||
this->FlagMap["SuppressStartupBanner"] =
|
||||
this->Version < cmLocalVisualStudioGenerator::VS10 ? "FALSE" : "";
|
||||
this->Version < cmGlobalVisualStudioGenerator::VS10 ? "FALSE" : "";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ cmVisualStudioGeneratorOptions
|
|||
{
|
||||
return;
|
||||
}
|
||||
if(this->Version >= cmLocalVisualStudioGenerator::VS10)
|
||||
if(this->Version >= cmGlobalVisualStudioGenerator::VS10)
|
||||
{
|
||||
// if there are configuration specific flags, then
|
||||
// use the configuration specific tag for PreprocessorDefinitions
|
||||
|
@ -298,7 +298,7 @@ cmVisualStudioGeneratorOptions
|
|||
{
|
||||
// Escape the definition for the compiler.
|
||||
std::string define;
|
||||
if(this->Version < cmLocalVisualStudioGenerator::VS10)
|
||||
if(this->Version < cmGlobalVisualStudioGenerator::VS10)
|
||||
{
|
||||
define =
|
||||
this->LocalGenerator->EscapeForShell(di->c_str(), true);
|
||||
|
@ -308,7 +308,7 @@ cmVisualStudioGeneratorOptions
|
|||
define = *di;
|
||||
}
|
||||
// Escape this flag for the IDE.
|
||||
if(this->Version >= cmLocalVisualStudioGenerator::VS10)
|
||||
if(this->Version >= cmGlobalVisualStudioGenerator::VS10)
|
||||
{
|
||||
define = cmVisualStudio10GeneratorOptionsEscapeForXML(define);
|
||||
|
||||
|
@ -325,7 +325,7 @@ cmVisualStudioGeneratorOptions
|
|||
fout << sep << define;
|
||||
sep = ";";
|
||||
}
|
||||
if(this->Version >= cmLocalVisualStudioGenerator::VS10)
|
||||
if(this->Version >= cmGlobalVisualStudioGenerator::VS10)
|
||||
{
|
||||
fout << ";%(PreprocessorDefinitions)</PreprocessorDefinitions>" << suffix;
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ void
|
|||
cmVisualStudioGeneratorOptions
|
||||
::OutputFlagMap(std::ostream& fout, const char* indent)
|
||||
{
|
||||
if(this->Version >= cmLocalVisualStudioGenerator::VS10)
|
||||
if(this->Version >= cmGlobalVisualStudioGenerator::VS10)
|
||||
{
|
||||
for(std::map<std::string, FlagValue>::iterator m = this->FlagMap.begin();
|
||||
m != this->FlagMap.end(); ++m)
|
||||
|
@ -395,7 +395,7 @@ cmVisualStudioGeneratorOptions
|
|||
{
|
||||
if(!this->FlagString.empty())
|
||||
{
|
||||
if(this->Version >= cmLocalVisualStudioGenerator::VS10)
|
||||
if(this->Version >= cmGlobalVisualStudioGenerator::VS10)
|
||||
{
|
||||
fout << prefix;
|
||||
if(this->Configuration.size())
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
void SetConfiguration(const char* config);
|
||||
private:
|
||||
cmLocalVisualStudioGenerator* LocalGenerator;
|
||||
cmLocalVisualStudioGenerator::VSVersion Version;
|
||||
cmGlobalVisualStudioGenerator::VSVersion Version;
|
||||
|
||||
std::string Configuration;
|
||||
Tool CurrentTool;
|
||||
|
|
Loading…
Reference in New Issue