aboutsummaryrefslogtreecommitdiff
path: root/devtools/create_project
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/create_project')
-rw-r--r--devtools/create_project/create_project.cpp3
-rw-r--r--devtools/create_project/msbuild.cpp24
-rw-r--r--devtools/create_project/msvc11/create_project.vcxproj2
3 files changed, 20 insertions, 9 deletions
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index df220f0934..c96b83414a 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -221,7 +221,7 @@ int main(int argc, char *argv[]) {
msvcVersion = atoi(argv[++i]);
- if (msvcVersion != 8 && msvcVersion != 9 && msvcVersion != 10) {
+ if (msvcVersion != 8 && msvcVersion != 9 && msvcVersion != 10 && msvcVersion != 11) {
std::cerr << "ERROR: Unsupported version: \"" << msvcVersion << "\" passed to \"--msvc-version\"!\n";
return -1;
}
@@ -643,6 +643,7 @@ void displayHelp(const char *exe) {
" 8 stands for \"Visual Studio 2005\"\n"
" 9 stands for \"Visual Studio 2008\"\n"
" 10 stands for \"Visual Studio 2010\"\n"
+ " 11 stands for \"Visual Studio 2012\"\n"
" The default is \"9\", thus \"Visual Studio 2008\"\n"
" --build-events Run custom build events as part of the build\n"
" (default: false)\n"
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index a82140c2d3..90a5e3c15b 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -46,7 +46,13 @@ const char *MSBuildProvider::getPropertiesExtension() {
}
int MSBuildProvider::getVisualStudioVersion() {
- return 2010;
+ if (_version == 10)
+ return 2010;
+
+ if (_version == 11)
+ return 2012;
+
+ error("Unsupported version passed to getVisualStudioVersion");
}
namespace {
@@ -58,9 +64,10 @@ inline void outputConfiguration(std::ostream &project, const std::string &config
"\t\t</ProjectConfiguration>\n";
}
-inline void outputConfigurationType(const BuildSetup &setup, std::ostream &project, const std::string &name, const std::string &config) {
+inline void outputConfigurationType(const BuildSetup &setup, std::ostream &project, const std::string &name, const std::string &config, int version) {
project << "\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"Configuration\">\n"
"\t\t<ConfigurationType>" << ((name == setup.projectName || setup.devTools) ? "Application" : "StaticLibrary") << "</ConfigurationType>\n"
+ "\t\t<PlatformToolset>v" << version << "0</PlatformToolset>"
"\t</PropertyGroup>\n";
}
@@ -98,17 +105,18 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
"\t\t<ProjectGuid>{" << uuid << "}</ProjectGuid>\n"
"\t\t<RootNamespace>" << name << "</RootNamespace>\n"
"\t\t<Keyword>Win32Proj</Keyword>\n"
+ "\t\t<VCTargetsPath Condition=\"'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and $(VisualStudioVersion) == ''\">$(VCTargetsPath11)</VCTargetsPath>\n"
"\t</PropertyGroup>\n";
// Shared configuration
project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n";
- outputConfigurationType(setup, project, name, "Release|Win32");
- outputConfigurationType(setup, project, name, "Analysis|Win32");
- outputConfigurationType(setup, project, name, "Debug|Win32");
- outputConfigurationType(setup, project, name, "Release|x64");
- outputConfigurationType(setup, project, name, "Analysis|x64");
- outputConfigurationType(setup, project, name, "Debug|x64");
+ outputConfigurationType(setup, project, name, "Release|Win32", _version);
+ outputConfigurationType(setup, project, name, "Analysis|Win32", _version);
+ outputConfigurationType(setup, project, name, "Debug|Win32", _version);
+ outputConfigurationType(setup, project, name, "Release|x64", _version);
+ outputConfigurationType(setup, project, name, "Analysis|x64", _version);
+ outputConfigurationType(setup, project, name, "Debug|x64", _version);
project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n"
"\t<ImportGroup Label=\"ExtensionSettings\">\n"
diff --git a/devtools/create_project/msvc11/create_project.vcxproj b/devtools/create_project/msvc11/create_project.vcxproj
index 5947211e35..c87461c049 100644
--- a/devtools/create_project/msvc11/create_project.vcxproj
+++ b/devtools/create_project/msvc11/create_project.vcxproj
@@ -63,6 +63,7 @@
</Link>
<PostBuildEvent>
<Command>@echo off
+xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc11\"
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc10\"
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc9\"
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc8\"
@@ -89,6 +90,7 @@ xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\iphone\"</Command>
</Link>
<PostBuildEvent>
<Command>@echo off
+xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc11\"
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc10\"
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc9\"
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc8\"