summaryrefslogtreecommitdiff
path: root/Modules/FindCUDA
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-09-18 16:41:20 -0400
committerCMake Topic Stage <kwrobot@kitware.com>2012-09-18 16:41:20 -0400
commit3dea63d04d683206cf05dc6d72cb5538222bfbc1 (patch)
tree31df33db56c848984cca67a8ea06b5a317bd6b31 /Modules/FindCUDA
parent21f5fc12ee4ca043838264962fc7608a97b8f35f (diff)
parentdb207e4065f4d1ecec9432cd4cc948f706bc973c (diff)
downloadcmake-3dea63d04d683206cf05dc6d72cb5538222bfbc1.tar.gz
Merge topic 'topics/FindCUDA/Add-CUDA_HOST_COMPILER'
db207e4 FindCUDA: Added CUDA_HOST_COMPILER variable.
Diffstat (limited to 'Modules/FindCUDA')
-rw-r--r--Modules/FindCUDA/run_nvcc.cmake12
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index 8274cc7189..f0aac8487a 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -62,6 +62,7 @@ set(cmake_dependency_file "@cmake_dependency_file@") # path
set(CUDA_make2cmake "@CUDA_make2cmake@") # path
set(CUDA_parse_cubin "@CUDA_parse_cubin@") # path
set(build_cubin @build_cubin@) # bool
+set(CUDA_HOST_COMPILER "@CUDA_HOST_COMPILER@") # bool
# We won't actually use these variables for now, but we need to set this, in
# order to force this file to be run again if it changes.
set(generated_file_path "@generated_file_path@") # path
@@ -102,8 +103,15 @@ endif()
# Add the build specific configuration flags
list(APPEND CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS_${build_configuration}})
-if(DEFINED CCBIN)
- set(CCBIN -ccbin "${CCBIN}")
+# Any -ccbin existing in CUDA_NVCC_FLAGS gets highest priority
+list( FIND CUDA_NVCC_FLAGS "-ccbin" ccbin_found0 )
+list( FIND CUDA_NVCC_FLAGS "--compiler-bindir" ccbin_found1 )
+if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 )
+ if (CUDA_HOST_COMPILER STREQUAL "$(VCInstallDir)bin" AND DEFINED CCBIN)
+ set(CCBIN -ccbin "${CCBIN}")
+ else()
+ set(CCBIN -ccbin "${CUDA_HOST_COMPILER}")
+ endif()
endif()
# cuda_execute_process - Executes a command with optional command echo and status message.