diff options
author | Brad King <brad.king@kitware.com> | 2018-04-02 14:05:03 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-04-02 14:05:13 (GMT) |
commit | 59713e856d54d9c0b248b8b3badaf46c289180f3 (patch) | |
tree | a3d13077730435873235bce59959b8e547f28feb | |
parent | 8f5b6962c9f43fda7f1c771bb41fd6db92bc4045 (diff) | |
parent | 23119366e9d4e56e13c1fdec9dbff5e8f8c55ee5 (diff) | |
download | CMake-59713e856d54d9c0b248b8b3badaf46c289180f3.zip CMake-59713e856d54d9c0b248b8b3badaf46c289180f3.tar.gz CMake-59713e856d54d9c0b248b8b3badaf46c289180f3.tar.bz2 |
Merge topic 'FindCUDA-nvcc-executable-env'
23119366e9 FindCUDA: Make nvcc configurable via CUDA_NVCC_EXECUTABLE env var
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1899
-rw-r--r-- | Modules/FindCUDA.cmake | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 119fc13..6f6f349 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -733,16 +733,20 @@ endif() # CUDA_NVCC_EXECUTABLE -cuda_find_host_program(CUDA_NVCC_EXECUTABLE - NAMES nvcc - PATHS "${CUDA_TOOLKIT_ROOT_DIR}" - ENV CUDA_PATH - ENV CUDA_BIN_PATH - PATH_SUFFIXES bin bin64 - NO_DEFAULT_PATH - ) -# Search default search paths, after we search our own set of paths. -cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) +if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) + set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") +else() + cuda_find_host_program(CUDA_NVCC_EXECUTABLE + NAMES nvcc + PATHS "${CUDA_TOOLKIT_ROOT_DIR}" + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + NO_DEFAULT_PATH + ) + # Search default search paths, after we search our own set of paths. + cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) +endif() mark_as_advanced(CUDA_NVCC_EXECUTABLE) if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) |