diff options
author | Tobias Ribizel <ribizel@kit.edu> | 2021-03-10 13:55:43 (GMT) |
---|---|---|
committer | Tobias Ribizel <ribizel@kit.edu> | 2021-03-15 20:34:05 (GMT) |
commit | 55233eee424816843bb0a5c820d3d4ebbdf3da27 (patch) | |
tree | f5f0524b8a4bbb28aba7d11199b78331f941ae53 /Modules/CMakeDetermineCompiler.cmake | |
parent | 336c57edd08354ecbda007491a1820b6371911b2 (diff) | |
download | CMake-55233eee424816843bb0a5c820d3d4ebbdf3da27.zip CMake-55233eee424816843bb0a5c820d3d4ebbdf3da27.tar.gz CMake-55233eee424816843bb0a5c820d3d4ebbdf3da27.tar.bz2 |
CUDA: Add support for finding nvcc in CUDA_PATH
Previously, nvcc needed to be present in PATH or specified by CUDACXX.
On Windows with vcpkg, the PATH is heavily modified, which lead to
nvcc not being found with the Ninja generator.
Diffstat (limited to 'Modules/CMakeDetermineCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompiler.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 2780399..6430793 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -68,6 +68,16 @@ macro(_cmake_find_compiler lang) ) endif() find_program(CMAKE_${lang}_COMPILER NAMES ${CMAKE_${lang}_COMPILER_LIST} DOC "${lang} compiler") + if(_CMAKE_${lang}_COMPILER_PATHS) + # As a last fall-back, search in language-specific paths + find_program(CMAKE_${lang}_COMPILER + NAMES ${CMAKE_${lang}_COMPILER_LIST} + NAMES_PER_DIR + PATHS ${_CMAKE_${lang}_COMPILER_PATHS} + DOC "${lang} compiler" + NO_DEFAULT_PATH + ) + endif() if(CMAKE_${lang}_COMPILER_INIT AND NOT CMAKE_${lang}_COMPILER) set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${CMAKE_${lang}_COMPILER_INIT}") endif() |