cuda: Extend vs10 target generator to use custom cuda path

This commit is contained in:
Benjamin Wozniak 2019-08-21 15:30:46 +02:00
parent df0247a371
commit 55b0532128

View File

@ -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()) {