|
@@ -26,6 +26,16 @@
|
|
|
static const char vs10generatorName[] = "Visual Studio 10 2010";
|
|
static const char vs10generatorName[] = "Visual Studio 10 2010";
|
|
|
static std::map<std::string, std::vector<cmIDEFlagTable>> loadedFlagJsonFiles;
|
|
static std::map<std::string, std::vector<cmIDEFlagTable>> loadedFlagJsonFiles;
|
|
|
|
|
|
|
|
|
|
+static void ConvertToWindowsSlashes(std::string& s)
|
|
|
|
|
+{
|
|
|
|
|
+ // first convert all of the slashes
|
|
|
|
|
+ for (auto& ch : s) {
|
|
|
|
|
+ if (ch == '/') {
|
|
|
|
|
+ ch = '\\';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// Map generator name without year to name with year.
|
|
// Map generator name without year to name with year.
|
|
|
static const char* cmVS10GenName(const std::string& name, std::string& genName)
|
|
static const char* cmVS10GenName(const std::string& name, std::string& genName)
|
|
|
{
|
|
{
|
|
@@ -212,7 +222,7 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!this->FindVCTargetsPath(mf)) {
|
|
|
|
|
|
|
+ if (this->CustomVCTargetsPath.empty() && !this->FindVCTargetsPath(mf)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -353,6 +363,11 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
|
|
|
if (const char* cudaDir = this->GetPlatformToolsetCudaCustomDir()) {
|
|
if (const char* cudaDir = this->GetPlatformToolsetCudaCustomDir()) {
|
|
|
mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR", cudaDir);
|
|
mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR", cudaDir);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (const char* vcTargetsDir = this->GetCustomVCTargetsPath()) {
|
|
|
|
|
+ mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR",
|
|
|
|
|
+ vcTargetsDir);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -446,6 +461,11 @@ bool cmGlobalVisualStudio10Generator::ProcessGeneratorToolsetField(
|
|
|
this->GeneratorToolsetVersion = value;
|
|
this->GeneratorToolsetVersion = value;
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (key == "VCTargetsPath") {
|
|
|
|
|
+ this->CustomVCTargetsPath = value;
|
|
|
|
|
+ ConvertToWindowsSlashes(this->CustomVCTargetsPath);
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -607,6 +627,14 @@ void cmGlobalVisualStudio10Generator::EnableLanguage(
|
|
|
cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
|
|
cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const char* cmGlobalVisualStudio10Generator::GetCustomVCTargetsPath() const
|
|
|
|
|
+{
|
|
|
|
|
+ if (this->CustomVCTargetsPath.empty()) {
|
|
|
|
|
+ return nullptr;
|
|
|
|
|
+ }
|
|
|
|
|
+ return this->CustomVCTargetsPath.c_str();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const
|
|
const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const
|
|
|
{
|
|
{
|
|
|
std::string const& toolset = this->GetPlatformToolsetString();
|
|
std::string const& toolset = this->GetPlatformToolsetString();
|