cuda: Extend vs10 target generator to use custom cuda path
This commit is contained in:
parent
df0247a371
commit
55b0532128
@ -526,6 +526,13 @@ void cmVisualStudio10TargetGenerator::Generate()
|
||||
}
|
||||
e1.Element("TargetFrameworkTargetsVersion", targetFrameworkVer);
|
||||
}
|
||||
if (!this->GlobalGenerator->GetPlatformToolsetCudaCustomDirString()
|
||||
.empty()) {
|
||||
e1.Element(
|
||||
"CudaToolkitCustomDir",
|
||||
this->GlobalGenerator->GetPlatformToolsetCudaCustomDirString() +
|
||||
"nvcc");
|
||||
}
|
||||
}
|
||||
|
||||
// Disable the project upgrade prompt that is displayed the first time a
|
||||
@ -612,10 +619,17 @@ void cmVisualStudio10TargetGenerator::Generate()
|
||||
e1.SetHasElements();
|
||||
|
||||
if (this->GlobalGenerator->IsCudaEnabled()) {
|
||||
auto customDir =
|
||||
this->GlobalGenerator->GetPlatformToolsetCudaCustomDirString();
|
||||
std::string cudaPath = customDir.empty()
|
||||
? "$(VCTargetsPath)\\BuildCustomizations\\"
|
||||
: customDir +
|
||||
"CUDAVisualStudioIntegration\\extras\\"
|
||||
"visual_studio_integration\\MSBuildExtensions\\";
|
||||
Elem(e1, "Import")
|
||||
.Attribute("Project",
|
||||
"$(VCTargetsPath)\\BuildCustomizations\\CUDA " +
|
||||
this->GlobalGenerator->GetPlatformToolsetCudaString() +
|
||||
std::move(cudaPath) + "CUDA " +
|
||||
this->GlobalGenerator->GetPlatformToolsetCuda() +
|
||||
".props");
|
||||
}
|
||||
if (this->GlobalGenerator->IsMasmEnabled()) {
|
||||
@ -698,10 +712,17 @@ void cmVisualStudio10TargetGenerator::Generate()
|
||||
e1.SetHasElements();
|
||||
this->WriteTargetsFileReferences(e1);
|
||||
if (this->GlobalGenerator->IsCudaEnabled()) {
|
||||
auto customDir =
|
||||
this->GlobalGenerator->GetPlatformToolsetCudaCustomDirString();
|
||||
std::string cudaPath = customDir.empty()
|
||||
? "$(VCTargetsPath)\\BuildCustomizations\\"
|
||||
: customDir +
|
||||
"CUDAVisualStudioIntegration\\extras\\"
|
||||
"visual_studio_integration\\MSBuildExtensions\\";
|
||||
Elem(e1, "Import")
|
||||
.Attribute("Project",
|
||||
"$(VCTargetsPath)\\BuildCustomizations\\CUDA " +
|
||||
this->GlobalGenerator->GetPlatformToolsetCudaString() +
|
||||
std::move(cudaPath) + "CUDA " +
|
||||
this->GlobalGenerator->GetPlatformToolsetCuda() +
|
||||
".targets");
|
||||
}
|
||||
if (this->GlobalGenerator->IsMasmEnabled()) {
|
||||
|
Loading…
Reference in New Issue
Block a user