From 0ad180d71294c513270b4d97cec40ad3af504faa Mon Sep 17 00:00:00 2001 From: Benjamin Wozniak Date: Wed, 21 Aug 2019 15:31:24 +0200 Subject: cuda: Extend cuda compiler detection to work with custom cuda path --- Modules/CMakeDetermineCompilerId.cmake | 10 ++++++++-- Modules/CompilerId/VS-10.vcxproj.in | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 0fcbbb7..40658ea 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -347,8 +347,14 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(cuda_tools "CUDA ${CMAKE_VS_PLATFORM_TOOLSET_CUDA}") set(id_compile "CudaCompile") set(id_PostBuildEvent_Command [[echo CMAKE_CUDA_COMPILER=$(CudaToolkitBinDir)\nvcc.exe]]) - string(CONCAT id_Import_props [[]]) - string(CONCAT id_Import_targets [[]]) + if(CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR) + set(id_CudaToolkitCustomDir "${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}nvcc") + string(CONCAT id_Import_props "") + string(CONCAT id_Import_targets "") + else() + string(CONCAT id_Import_props [[]]) + string(CONCAT id_Import_targets [[]]) + endif() if(CMAKE_VS_PLATFORM_NAME STREQUAL x64) set(id_ItemDefinitionGroup_entry "64") endif() diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in index 32c4ffc..d742274 100644 --- a/Modules/CompilerId/VS-10.vcxproj.in +++ b/Modules/CompilerId/VS-10.vcxproj.in @@ -14,6 +14,7 @@ @id_system_version@ @id_WindowsTargetPlatformVersion@ @id_WindowsSDKDesktopARMSupport@ + @id_CudaToolkitCustomDir@ @id_toolset_version_props@ -- cgit v0.12