summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorPatrick Gansterer <paroga@paroga.com>2013-08-05 10:49:32 (GMT)
committerPatrick Gansterer <paroga@paroga.com>2013-08-05 11:38:23 (GMT)
commit4b15dc855d8f5347169391b6a1a86320f2efaae4 (patch)
tree8174d7940f650b9b829d45de56cd804137289704 /Source
parent60e568cf790705b3ed7a61d6768ba6220bfbabe8 (diff)
downloadCMake-4b15dc855d8f5347169391b6a1a86320f2efaae4.zip
CMake-4b15dc855d8f5347169391b6a1a86320f2efaae4.tar.gz
CMake-4b15dc855d8f5347169391b6a1a86320f2efaae4.tar.bz2
VS: Set CMAKE_VS_PLATFORM_NAME for VS7 and VS71 too
Move the code which sets CMAKE_VS_PLATFORM_NAME from cmGlobalVisualStudio8Generator to cmGlobalVisualStudio7Generator.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx29
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h6
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx15
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h3
5 files changed, 35 insertions, 26 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 2494f55..24ca0b1 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -281,20 +281,20 @@ void cmGlobalVisualStudio71Generator
const std::set<std::string>& configsPartOfDefaultBuild,
const char* platformMapping)
{
+ const char* platformName =
+ platformMapping ? platformMapping : this->GetPlatformName();
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
fout << "\t\t{" << guid << "}." << *i
- << ".ActiveCfg = " << *i << "|"
- << (platformMapping ? platformMapping : "Win32") << std::endl;
+ << ".ActiveCfg = " << *i << "|" << platformName << std::endl;
std::set<std::string>::const_iterator
ci = configsPartOfDefaultBuild.find(*i);
if(!(ci == configsPartOfDefaultBuild.end()))
{
fout << "\t\t{" << guid << "}." << *i
- << ".Build.0 = " << *i << "|"
- << (platformMapping ? platformMapping : "Win32") << std::endl;
+ << ".Build.0 = " << *i << "|" << platformName << std::endl;
}
}
}
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 9a34ecf..812659e 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -144,6 +144,27 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator()
return lg;
}
+//----------------------------------------------------------------------------
+void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf)
+{
+ cmGlobalVisualStudioGenerator::AddPlatformDefinitions(mf);
+ mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName());
+}
+
+//----------------------------------------------------------------------------
+const char* cmGlobalVisualStudio7Generator::GetPlatformName() const
+{
+ if (!this->PlatformName.empty())
+ {
+ return this->PlatformName.c_str();
+ }
+ if (this->ArchitectureId == "X86")
+ {
+ return "Win32";
+ }
+ return this->ArchitectureId.c_str();
+}
+
void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf)
{
// process the configurations
@@ -601,20 +622,20 @@ void cmGlobalVisualStudio7Generator
const std::set<std::string>& configsPartOfDefaultBuild,
const char* platformMapping)
{
+ const char* platformName =
+ platformMapping ? platformMapping : this->GetPlatformName();
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
fout << "\t\t{" << guid << "}." << *i
- << ".ActiveCfg = " << *i << "|"
- << (platformMapping ? platformMapping : "Win32") << "\n";
+ << ".ActiveCfg = " << *i << "|" << platformName << "\n";
std::set<std::string>::const_iterator
ci = configsPartOfDefaultBuild.find(*i);
if(!(ci == configsPartOfDefaultBuild.end()))
{
fout << "\t\t{" << guid << "}." << *i
- << ".Build.0 = " << *i << "|"
- << (platformMapping ? platformMapping : "Win32") << "\n";
+ << ".Build.0 = " << *i << "|" << platformName << "\n";
}
}
}
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 3ebb408..dfa8547 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -36,9 +36,14 @@ public:
return cmGlobalVisualStudio7Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 7";}
+ ///! Get the name for the platform.
+ const char* GetPlatformName() const;
+
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator();
+ virtual void AddPlatformDefinitions(cmMakefile* mf);
+
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
@@ -153,6 +158,7 @@ protected:
// Set during OutputSLNFile with the name of the current project.
// There is one SLN file per project.
std::string CurrentProject;
+ std::string PlatformName;
};
#define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 864e8db..558b6b6 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -113,20 +113,6 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
}
//----------------------------------------------------------------------------
-const char* cmGlobalVisualStudio8Generator::GetPlatformName() const
-{
- if (!this->PlatformName.empty())
- {
- return this->PlatformName.c_str();
- }
- if (this->ArchitectureId == "X86")
- {
- return "Win32";
- }
- return this->ArchitectureId.c_str();
-}
-
-//----------------------------------------------------------------------------
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator()
{
@@ -142,7 +128,6 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator()
void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
{
cmGlobalVisualStudio71Generator::AddPlatformDefinitions(mf);
- mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName());
if(this->TargetsWindowsCE())
{
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index bcbd7a0..262acad 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -30,8 +30,6 @@ public:
///! Get the name for the generator.
virtual const char* GetName() const {return this->Name.c_str();}
- const char* GetPlatformName() const;
-
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
@@ -87,7 +85,6 @@ protected:
const char* path, cmTarget &t);
std::string Name;
- std::string PlatformName;
std::string WindowsCEVersion;
private: