summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-10-22 12:24:11 (GMT)
committerBrad King <brad.king@kitware.com>2009-10-22 12:24:11 (GMT)
commit50759a9ed3f7be7763fbbd6b54a338607ab3a513 (patch)
treed8e7f4f680e3ea2b0ec109eee10844fcb8959ee6 /Source
parente1c1ab7197785b54de9b36f6b335419f333d9f12 (diff)
downloadCMake-50759a9ed3f7be7763fbbd6b54a338607ab3a513.zip
CMake-50759a9ed3f7be7763fbbd6b54a338607ab3a513.tar.gz
CMake-50759a9ed3f7be7763fbbd6b54a338607ab3a513.tar.bz2
WIP: VS 10 Win64 generator
See issue #9754.
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx3
-rw-r--r--Source/cmGlobalVisualStudio10Win64Generator.cxx37
-rw-r--r--Source/cmGlobalVisualStudio10Win64Generator.h36
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h2
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx8
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx15
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h6
-rw-r--r--Source/cmake.cxx3
9 files changed, 98 insertions, 14 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index d188b11..9099691 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -303,6 +303,8 @@ IF (WIN32)
cmLocalVisualStudio10Generator.h
cmGlobalVisualStudio10Generator.h
cmGlobalVisualStudio10Generator.cxx
+ cmGlobalVisualStudio10Win64Generator.h
+ cmGlobalVisualStudio10Win64Generator.cxx
cmGlobalVisualStudioGenerator.cxx
cmGlobalVisualStudioGenerator.h
cmGlobalWatcomWMakeGenerator.cxx
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index b6ae951..d909742 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -37,7 +37,8 @@ void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator *cmGlobalVisualStudio10Generator::CreateLocalGenerator()
{
- cmLocalGenerator*lg = new cmLocalVisualStudio10Generator;
+ cmLocalVisualStudio10Generator* lg = new cmLocalVisualStudio10Generator;
+ lg->SetPlatformName(this->PlatformName.c_str());
lg->SetGlobalGenerator(this);
return lg;
}
diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx
new file mode 100644
index 0000000..0e821c7
--- /dev/null
+++ b/Source/cmGlobalVisualStudio10Win64Generator.cxx
@@ -0,0 +1,37 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ 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.
+============================================================================*/
+#include "cmGlobalVisualStudio10Win64Generator.h"
+#include "cmMakefile.h"
+#include "cmake.h"
+
+//----------------------------------------------------------------------------
+cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator()
+{
+ this->PlatformName = "x64";
+}
+
+//----------------------------------------------------------------------------
+void cmGlobalVisualStudio10Win64Generator
+::GetDocumentation(cmDocumentationEntry& entry) const
+{
+ entry.Name = this->GetName();
+ entry.Brief = "Generates Visual Studio 10 Win64 project files.";
+ entry.Full = "";
+}
+
+//----------------------------------------------------------------------------
+void cmGlobalVisualStudio10Win64Generator::EnableLanguage(
+ std::vector<std::string> const& lang, cmMakefile *mf, bool optional)
+{
+ mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
+ cmGlobalVisualStudio10Generator::EnableLanguage(lang, mf, optional);
+}
diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h
new file mode 100644
index 0000000..51b68c0
--- /dev/null
+++ b/Source/cmGlobalVisualStudio10Win64Generator.h
@@ -0,0 +1,36 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ 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.
+============================================================================*/
+#ifndef cmGlobalVisualStudio10Win64Generator_h
+#define cmGlobalVisualStudio10Win64Generator_h
+
+#include "cmGlobalVisualStudio10Generator.h"
+
+class cmGlobalVisualStudio10Win64Generator :
+ public cmGlobalVisualStudio10Generator
+{
+public:
+ cmGlobalVisualStudio10Win64Generator();
+ static cmGlobalGenerator* New() {
+ return new cmGlobalVisualStudio10Win64Generator; }
+
+ ///! Get the name for the generator.
+ virtual const char* GetName() const {
+ return cmGlobalVisualStudio10Win64Generator::GetActualName();}
+ static const char* GetActualName() {return "Visual Studio 10 Win64";}
+
+ /** Get the documentation entry for this generator. */
+ virtual void GetDocumentation(cmDocumentationEntry& entry) const;
+
+ virtual void EnableLanguage(std::vector<std::string>const& languages,
+ cmMakefile *, bool optional);
+};
+#endif
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index 7370ef6..9d836bd 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -38,6 +38,8 @@ public:
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator();
+ std::string const& GetPlatformName() const { return this->PlatformName; }
+
/**
* Override Configure and Generate to add the build-system check
* target.
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 382192e0..8df0ffa 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -13,7 +13,7 @@
#include "cmTarget.h"
#include "cmMakefile.h"
#include "cmVisualStudio10TargetGenerator.h"
-#include "cmGlobalVisualStudio7Generator.h"
+#include "cmGlobalVisualStudio10Generator.h"
#include <cm_expat.h>
#include "cmXMLParser.h"
class cmVS10XMLParser : public cmXMLParser
@@ -93,9 +93,9 @@ void cmLocalVisualStudio10Generator::Generate()
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
{
- cmVisualStudio10TargetGenerator tg(&l->second,
- (cmGlobalVisualStudio7Generator*)
- this->GetGlobalGenerator());
+ cmVisualStudio10TargetGenerator tg(
+ &l->second, static_cast<cmGlobalVisualStudio10Generator*>(
+ this->GetGlobalGenerator()));
tg.Generate();
}
this->WriteStampFiles();
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 74a6df4..e1c1fba 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -10,7 +10,7 @@
See the License for more information.
============================================================================*/
#include "cmVisualStudio10TargetGenerator.h"
-#include "cmGlobalVisualStudio7Generator.h"
+#include "cmGlobalVisualStudio10Generator.h"
#include "cmTarget.h"
#include "cmComputeLinkInformation.h"
#include "cmGeneratedFileStream.h"
@@ -32,7 +32,7 @@ static std::string cmVS10EscapeXML(std::string arg)
cmVisualStudio10TargetGenerator::
cmVisualStudio10TargetGenerator(cmTarget* target,
- cmGlobalVisualStudio7Generator* gg)
+ cmGlobalVisualStudio10Generator* gg)
{
this->GlobalGenerator = gg;
this->Target = target;
@@ -43,7 +43,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
this->Name = this->Target->GetName();
this->GlobalGenerator->CreateGUID(this->Name.c_str());
this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str());
- this->Platform = "|Win32";
+ this->Platform = gg->GetPlatformName();
this->ComputeObjectNames();
this->BuildFileStream = 0;
}
@@ -80,7 +80,7 @@ void cmVisualStudio10TargetGenerator::WritePlatformConfigTag(
(*stream ) << "";
(*stream ) << "<" << tag
<< " Condition=\"'$(Configuration)|$(Platform)'=='";
- (*stream ) << config << this->Platform << "'\"";
+ (*stream ) << config << "|" << this->Platform << "'\"";
if(attribute)
{
(*stream ) << attribute;
@@ -141,6 +141,8 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<SccProjectName />\n", 2);
this->WriteString("<SccLocalPath />\n", 2);
this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
+ this->WriteString("<Platform>", 2);
+ (*this->BuildFileStream) << this->Platform << "</Platform>\n";
this->WriteString("</PropertyGroup>\n", 1);
this->WriteString("<Import Project="
"\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n",
@@ -187,10 +189,11 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurations()
i != configs->end(); ++i)
{
this->WriteString("<ProjectConfiguration Include=\"", 2);
- (*this->BuildFileStream ) << *i << this->Platform << "\">\n";
+ (*this->BuildFileStream ) << *i << "|" << this->Platform << "\">\n";
this->WriteString("<Configuration>", 3);
(*this->BuildFileStream ) << *i << "</Configuration>\n";
- this->WriteString("<Platform>Win32</Platform>\n", 3);
+ this->WriteString("<Platform>", 3);
+ (*this->BuildFileStream) << this->Platform << "</Platform>\n";
this->WriteString("</ProjectConfiguration>\n", 2);
}
this->WriteString("</ItemGroup>\n", 1);
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 127554f..f70a066 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -16,7 +16,7 @@
class cmTarget;
class cmMakefile;
class cmGeneratedFileStream;
-class cmGlobalVisualStudio7Generator;
+class cmGlobalVisualStudio10Generator;
class cmSourceFile;
class cmCustomCommand;
class cmLocalVisualStudio7Generator;
@@ -27,7 +27,7 @@ class cmVisualStudio10TargetGenerator
{
public:
cmVisualStudio10TargetGenerator(cmTarget* target,
- cmGlobalVisualStudio7Generator* gg);
+ cmGlobalVisualStudio10Generator* gg);
~cmVisualStudio10TargetGenerator();
void Generate();
// used by cmVisualStudioGeneratorOptions
@@ -82,7 +82,7 @@ private:
std::string Platform;
std::string GUID;
std::string Name;
- cmGlobalVisualStudio7Generator* GlobalGenerator;
+ cmGlobalVisualStudio10Generator* GlobalGenerator;
cmGeneratedFileStream* BuildFileStream;
cmLocalVisualStudio7Generator* LocalGenerator;
std::set<cmSourceFile*> SourcesVisited;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index a40d89e..b9162bb 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -63,6 +63,7 @@
# include "cmGlobalVisualStudio9Generator.h"
# include "cmGlobalVisualStudio9Win64Generator.h"
# include "cmGlobalVisualStudio10Generator.h"
+# include "cmGlobalVisualStudio10Win64Generator.h"
# include "cmGlobalVisualStudio8Win64Generator.h"
# include "cmGlobalBorlandMakefileGenerator.h"
# include "cmGlobalNMakeMakefileGenerator.h"
@@ -2364,6 +2365,8 @@ void cmake::AddDefaultGenerators()
&cmGlobalVisualStudio7Generator::New;
this->Generators[cmGlobalVisualStudio10Generator::GetActualName()] =
&cmGlobalVisualStudio10Generator::New;
+ this->Generators[cmGlobalVisualStudio10Win64Generator::GetActualName()] =
+ &cmGlobalVisualStudio10Win64Generator::New;
this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] =
&cmGlobalVisualStudio71Generator::New;
this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] =